Diagnose DNS problem

2

Ubuntu Maverick 10.10 i386 (beta).

From my box I can ping any host outside my gateway or on local network (including my DNS server).

But I can't resolve any domain name:

$ nslookup google.com
;; connection timed out; no servers could be reached

Please help me to diagnose this problem.

Alexander Gladysh

Posted 2010-10-01T18:04:27.940

Reputation: 792

Answers

4

You don't have proper DNS servers listed in /etc/resolv.conf

Edit it as root and add these two lines-

nameserver 8.8.8.8
nameserver 8.8.4.4

This will add the Google Public DNS servers. Try resolving domains after that. If it doesn't work, run /etc/rc.d/network restart (or reboot your box).

Nilesh

Posted 2010-10-01T18:04:27.940

Reputation: 203

It worked, thanks. Very strange: DNS worked properly this morning, I haven't changed system settings (just used some wi-fi and then connected back to my home network). Also my /etc/network/interfaces already have the line "dns-nameservers 8.8.8.8"... – Alexander Gladysh – 2010-10-01T18:14:28.450

1I don't know about exact ubuntu design, but I know one thing- the Linux resolver library checks /etc/resolv.conf for preferred DNS servers, and you didn't have them in the file. DNS may've worked in the morning due to gateway or something else. – Nilesh – 2010-10-02T05:53:54.517

1Funny thing. Entries in /etc/resolv.conf are cleared each time I connect to WiFi network and then switch back to the cable. – Alexander Gladysh – 2010-10-08T16:16:02.367

1

Yes, because Ubuntu uses its own Network Manager to configure interfaces and protocols. Try checking the content of /etc/NetworkManager/system-connections/. Here you will find the configuration files for your interfaces. After modification, do a sudo service network-manager restart

Akos

Posted 2010-10-01T18:04:27.940

Reputation: 11