DNS client does not sent any DNS request

Discussion in 'Linux Networking' started by Chen Zhigao, Sep 12, 2005.

  1. Chen Zhigao

    Chen Zhigao Guest

    Hi folks,

    I am building an embedded Linux settop box and try to install
    networking packages as few as possible. I have installed the netbase,
    netkit-inetd, netkit-ping and portmap packages from MontaVista.

    The settop box, with the static IP of 10.10.10.100, is connected to my
    desktop PC through a cross cable, which servers as a router to forward
    the packages from/to the set-top box to/from the our LAN. The IP of my
    desktop PC are 10.10.10.1 and 192.168.0.151. The LAN gateway's IP is
    192.168.0.1.

    Since my desktop PC use the LAN gateway as DNS server, I use it as the
    DNS server for the set-top box also. The contents of the configuration
    files on the box are:

    # /etc/resolv.conf
    search localdomain
    nameserver 192.168.0.1

    # /etc/host.conf
    order hosts,bind
    multi on

    However, the set-top box can not ping any host on the Internet by DNS
    name, although it can them ping by IP address. The error says "ping:
    unknown host xxx.xxx.xx". Actually I can not capture any DNS request
    sent out of the set-top box.

    But nslookup works fine. And I am sure the LAN gateway allows the box
    to request to resolve DNS, because nslookup tells me it use the gateway
    as DNS server. I am still not able to ping a host by DNS even though I
    install nslookup.

    Do I miss some packages? Appreciate it if you could sheld some light?

    Zhigao
     
    Chen Zhigao, Sep 12, 2005
    #1
    1. Advertisements

  2. Try adding the host route

    route add 192.168.0.1 gw 10.10.10.1

    on the set-top and the host route

    route add 10.10.10.100 gw 192.168.0.151

    to the gateway.
     
    Clifford Kite, Sep 12, 2005
    #2
    1. Advertisements

  3. Chen Zhigao

    Moe Trin Guest

    In the Usenet newsgroup comp.os.linux.networking, in article
    I'm not familiar with the MontaVista packages, so I'm not sure what
    all that includes and doesn't include.
    The search term probably isn't useful.
    OK - what about the file /etc/nsswitch.conf ? It is normally used with the
    modern C libraries, and should have (among others) a line that reads

    hosts: files dns

    as a minimum. As you include portmap, you may also need the NIS setup,

    hosts: files nisplus nis dns

    See the man page.
    mslookup (and dig, and dnsquery and host) are tools to query a name server.
    That's all they do. Your applications use the resolver libraries, and part
    of this is being able to query the /etc/hosts file, and perhaps the NIS
    servers. They use a configuration file (/etc/host.conf under the older
    libc5, /etc/nsswitch.conf under glibc2) to discover which source to use
    when resolving names.

    [compton ~]$ whatis nsswitch.conf
    nsswitch.conf [nsswitch] (5) - System Databases and Name Service Switch
    configuration file
    [compton ~]$

    /etc/host.conf is included in most installations for compatibility, though
    I've forgotten what applications/libraries may still use it.

    Old guy
     
    Moe Trin, Sep 13, 2005
    #3
  4. Chen Zhigao

    Chen Zhigao Guest

    The set-top box has been able to reach 192.168.0.1, so the first route
    you gave is not necessary and the problem does not go away.

    The gateway is out of my control, I won't be able to add the second one
    on the gateway route table. Even if I can do so, I think the problem is
    not the ability for the gateway to reach the box but the incapability
    for the box to send out DNS request.
     
    Chen Zhigao, Sep 13, 2005
    #4
  5. Chen Zhigao

    Chen Zhigao Guest

    OK - what about the file /etc/nsswitch.conf ? It is normally used with the
    modern C libraries, and should have (among others) a line that reads
    My /etc/nsswitch.conf contains this line actually. I do not use NIS.
    I found there are a libnss_dns.so and a libresolv.so under glibc. After
    I installed them, DNS starts working! Thanks a lot for the pointer.
     
    Chen Zhigao, Sep 13, 2005
    #5
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.