• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 274
  • Last Modified:

configuring a DNS client

My linux server cannot resolve domain names, though it has no trouble connecting to remote ip addresses. The router between it and the internet seems to providing the server with the addresses of valid DNS servers, and the server successfully stores these addresses in /etc/resolv.conf. I'm fairly sure the router is correctly configured, because another machine (this one a windows machine) I've connected to the router has no trouble resolving domain names. Any suggestions as to which of my servers settings need to be modifed?

Thanks.
0
bobwood2000
Asked:
bobwood2000
  • 8
  • 8
1 Solution
 
wesly_chenCommented:
Hi,

    What do you mean the remote IP addresses? Are those internet IP addresses or private addresses such your router?

   First, please try to ping the IP address of www.yahoo.com (66.94.230.38) to see if your Linux server can ping the ineternet.
If not, please check your default gateway setting by typing "netstat -rn". Make sure you can ping 66.94.230.38 first.

   Second, can your Linux server ping the IP address of DNS server which are in the /etc/resolv.conf? If you can ping the internet
IP addresses but can not ping DNS server, then either the DNS server down or the IP of DNS server is wrong. Since the Linux server
use DHCP to get address, you may need to check the DHCP server(on router?) to make sure you can ping the DNS server on the
DHCP server.

   If those steps cannot fix your problem, then please provide your content of /etc/resolv.conf and the output of "netstat -rn" as well as your
router's IP address. Those can help people to trace the problem.

Regards,

Wesly
0
 
wesly_chenCommented:
Hi,

     One more thing, please check /etc/nsswitch.conf. Make sure there is "dns" in "hosts: files dns" so it will querry the dns.

Wesly
0
 
bobwood2000Author Commented:
I should have said "external ip addresses" rather than "remote ip addresses". I have no trouble pinging or otherwise connecting to any ip addresses, internal or external. I also have no trouble pinging the dns servers in /etc/resolv.conf. The gateway router (192.168.1.1) appears to be correctly reported by netstat.

# cat /etc/resolv.conf
search
nameserver 199.166.28.10
nameserver 199.5.157.128
nameserver 199.166.29.3

# netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0
0.0.0.0         192.168.1.1     0.0.0.0         UG        0 0          0 eth0
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
bobwood2000Author Commented:
Also, my /etc/resolv.conf file contains the line "hosts: files dns".
0
 
wesly_chenCommented:
Ok, the next step is check the firewall setting on your Linux box if you have one.
iptables or ipchains are the softwares to limit the network access in/out your Linux box.
Please turn it off by the following commands:
service iptables stop
service ipchains stop
And then turn then off on the boot-up
chkconfig --level 2345 iptables off
chkconfig --level 2345 ipchains off

One more thing, please check the nameservers in /etc/resolv.conf is the same as what you got in Windows (ipconofig /all).
And its file permission is 644 (-rw-r--r--).

Wesly
0
 
bobwood2000Author Commented:
ipchains and iptables were installed, but not active. I removed them just to be sure, such the commands "apt-get remove iptables" and "apt-get remove ipchains". It's really a very minimalist linux installation by now. Here's the output of ps -ax. There is no sign of any extra services running, that I can see.

# ps -ax
Warning: bad syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html
  PID TTY      STAT   TIME COMMAND
    1 ?        S      0:00 init [2]
    2 ?        S      0:00 [keventd]
    3 ?        SN     0:00 [ksoftirqd_CPU0]
    4 ?        S      0:00 [kswapd]
    5 ?        S      0:00 [bdflush]
    6 ?        S      0:00 [kupdated]
   18 ?        S      0:00 [ahc_dv_0]
   19 ?        S      0:00 [ahc_dv_1]
   20 ?        S      0:00 [scsi_eh_0]
   21 ?        S      0:00 [scsi_eh_1]
   23 ?        S      0:00 [scsi_eh_2]
   59 ?        S      0:00 [kjournald]
  350 ?        S      0:00 [khubd]
  649 ?        Ss     0:00 /sbin/syslogd
  652 ?        Ss     0:00 /sbin/klogd
  683 ?        Ss     0:00 /usr/sbin/exim4 -bd -q30m
  688 ?        Ss     0:00 /usr/sbin/inetd
  787 ?        Ss     0:00 /usr/sbin/sshd
  791 ?        Ss     0:00 /usr/sbin/atd
  794 ?        Ss     0:00 /usr/sbin/cron
  811 tty1     Ss+    0:00 -bash
  812 tty2     Ss+    0:00 /sbin/getty 38400 tty2
  813 tty3     Ss+    0:00 /sbin/getty 38400 tty3
  814 tty4     Ss+    0:00 /sbin/getty 38400 tty4
  815 tty5     Ss+    0:00 /sbin/getty 38400 tty5
  816 tty6     Ss+    0:00 /sbin/getty 38400 tty6
 3917 ?        Rs     0:00 sshd: root@pts/0
 3920 pts/0    Ss     0:00 -bash
 5426 pts/0    R+     0:00 ps -ax
0
 
bobwood2000Author Commented:
/etc/resolv has 644 permissions.

# ls -l resolv.conf
-rw-r--r--  1 root root 74 Oct 25 13:57 resolv.conf

The dns servers are the same as my received when my windows box connected via dhcp to the router. I think I'm no longer using dhcp however, because I wanted the linux server to get the same internal ip (192.168....) each time. Still, the dns servers in resolv.conf are the same publically available servers that worked with a windows box.

Thanks for sticking with me through this.
0
 
wesly_chenCommented:
Well, which Linux distro do you use?

Wesly
0
 
bobwood2000Author Commented:
Debian.
0
 
wesly_chenCommented:
OK, no matter what distro you have, let's go for "nslookup" to debug DNS.
Please type in "nslookup" and you will get ">" prompt.
Then type in "server 199.166.28.10" and Enter.
Then type in "www.yahoo.com" and Enter.
Please give me the output of the result.

Thanks,

Wesly
0
 
bobwood2000Author Commented:
I've never used nslookup before, so I don't know what any of this output means:

# nslookup
Note:  nslookup is deprecated and may be removed from future releases.
Consider using the `dig' or `host' programs instead.  Run nslookup with
the `-sil[ent]' option to prevent this message from appearing.
> server 199.166.28.10
Default server: 199.166.28.10
Address: 199.166.28.10#53
www.yahoo.com
Server:         199.166.28.10
Address:        199.166.28.10#53

Non-authoritative answer:
*** Can't find www.yahoo.com: No answer
>
0
 
wesly_chenCommented:
Can you do the same thing in the Windows command prompt?

I suspect the UDP port 53 on your Linux box has some issue.
Check the /etc/services to check whether is TCP 53 and UDP 53 such as:
--------------------
domain             53/tcp                           #Domain Name Server
domain             53/udp                           #Domain Name Server
--------------------

Wesly
0
 
bobwood2000Author Commented:
Unfortunately I don't have access to that Windows box any more.

The /etc/services file seems to have something like what you said.  What should I make of this?

# grep nameserver /etc/services
nameserver      42/tcp          name            # IEN 116
domain          53/tcp          nameserver      # name-domain server
domain          53/udp          nameserver
0
 
wesly_chenCommented:
Do you have a internal DNS server?
Try to use "nslookup" and set the "> server" to the IP of internal server.
Or can you have another Windows PC on the network to test the nslookup.

Wesly
0
 
bobwood2000Author Commented:
Just reinstalling Linux seems to have worked. Thanks for all your help.
0
 
wesly_chenCommented:
Well, it seems like some of shared libraries used by dns query are corrupted.
Anyway, glad to nnow your problem is resolved.

Wesly
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 8
  • 8
Tackle projects and never again get stuck behind a technical roadblock.
Join Now