Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

configuring a DNS client

Posted on 2004-10-24
16
Medium Priority
?
271 Views
Last Modified: 2013-12-15
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
Comment
Question by:bobwood2000
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 8
16 Comments
 
LVL 38

Expert Comment

by:wesly_chen
ID: 12396861
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
 
LVL 38

Expert Comment

by:wesly_chen
ID: 12397188
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
 

Author Comment

by:bobwood2000
ID: 12397766
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:bobwood2000
ID: 12397781
Also, my /etc/resolv.conf file contains the line "hosts: files dns".
0
 
LVL 38

Expert Comment

by:wesly_chen
ID: 12406268
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
 

Author Comment

by:bobwood2000
ID: 12406417
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
 

Author Comment

by:bobwood2000
ID: 12406435
/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
 
LVL 38

Expert Comment

by:wesly_chen
ID: 12406450
Well, which Linux distro do you use?

Wesly
0
 

Author Comment

by:bobwood2000
ID: 12406618
Debian.
0
 
LVL 38

Expert Comment

by:wesly_chen
ID: 12407105
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
 

Author Comment

by:bobwood2000
ID: 12407590
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
 
LVL 38

Expert Comment

by:wesly_chen
ID: 12407686
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
 

Author Comment

by:bobwood2000
ID: 12407853
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
 
LVL 38

Accepted Solution

by:
wesly_chen earned 1000 total points
ID: 12417057
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
 

Author Comment

by:bobwood2000
ID: 12418776
Just reinstalling Linux seems to have worked. Thanks for all your help.
0
 
LVL 38

Expert Comment

by:wesly_chen
ID: 12418795
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question