hostname resolution stopped working!

Hi,

I have a dual boot installation on my laptop with Opensuse 13.1 and Windows 7. Suddenly, my opensuse installation isn’t able to resolve hostnames. DHCP client is able to obtain an IP address and I am able to connect to other computers on my network using their IP addresses just fine. My other computers and Windows 7 installation on the same laptop work fine. So far I have tried, connecting through wired interface, booting into an older kernel, but nothing has made any difference. I tried running nslookup, but that too waits for a long time and returns with no server for hostname resolution. I have run of ideas on how to investigate this problem.

Has anyone experienced a similar issue? Any resolution or suggestions?

Thanks

Hi
Might be a stale arp entry, do you get output from;


/sbin/arp

The router dishing up the ip address may need a reboot, else check the entries in /etc/resolv.conf for nameserver entries.

When you are having the problem did you check your system to see if DNS
client settings were in place?

Code:

grep nameserver /etc/resolv.conf

Also, what do you expect your DNS service’s IP to be within your network?
Pretending it is 192.168.1.254, use the following command with a hostname
you wish to lookup instead of targethostname and post the full command and
output:

Code:

dig @192.168.1.254 targethostname


Good luck.

If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below…

Is this a samba network? If so, can you find machines by name using the following?

nmblookup <machine name>
  1. You need to test name resolution for other machines on your network vs public domain names, more than likely and especially if your local network is a workgroup and not a Domain, Host names will be resolved differently.
  2. Are you running a workgroup or a Domain? A workgroup will resolve names by election and browse master which may change if you boot new, powerful machines into your workgroup. On the other hand, Domains implement local DNS servers which are authoritative for name resolution and never change. This is typically resolved by just waiting a few minutes.
  3. If you multi-boot your machine, verify each OS implements a <different> MAC address. I’ve seen machines incorrectly identified on the network because identity is associated with the MAC address in multiple places but of course when you reboot into a different OS your machine is actually different.

TSU

Thanks for all these great suggestions. Just to add some clarification.

  • I have an ubuntu server on my network that acts as dhcp server. I suspected that to be a problem and have since rebooted it. That hasn’t made any difference.
  • Since everything works fine when I boot into windows, that kind of rules out any hardware malfunction.
  • I also tried changing the network-manager settings to just get the addresses and used hard-coded DNS server to 8.8.8.8 (google’s public DNS). That too, didn’t help.
  • I tried wired LAN connection to get a fresh IP address, that too had the same problem.

I have no entries for namserver (or anything else) in my /etc/resolv.conf

/sbin/arp with no arguments returned two IP addresses associated with my wifi interface, which I believe are my DNS (my Ubuntu server) and gateway server IP (my router’s IP) addresses and they appear to be correct.

Now, the outputs of dig commands were interesting.

if I used explicit @DNS server address, my ubuntu (DHCP) server’s IP address or even 8.8.8.8 (google’s DNS), name resolution works great. If I omit explicit @dsn address, dig commands waits for about 30 seconds before failing with “connection timed out; no servers could be reached”

Additionally, from what I can tell, the output of nmcli dev list iface <my wifi iface> shows DNS server addresses listed correctly.

Anything else I should check?

Thanks again for your suggestions.

> I have no entries for namserver (or anything else) in my
> /etc/resolv.conf

This is the problem. If you have no nameservers, you have no chance of
resolving DNS stuff, locally or otherwise.

> if I used explicit @DNS server address, my ubuntu (DHCP) server’s IP
> address or even 8.8.8.8 (google’s DNS), name resolution works great. If
> I omit explicit @dsn address, dig commands waits for about 30 seconds
> before failing with “connection timed out; no servers could be reached”

Yes, if you tell it to use a DNS server, all is well. If not, it tries
the system values (not configured) and naturally fails since you do not
have any DNS configured.

Try running the following command:

Code:

sudo /sbin/netconfig -f update

Once done, check your /etc/resolv.conf file again to see what it has. If
nothing, reboot. If still nothing, try this and post the output:

Code:

sudo /usr/sbin/dhcpcd-test wlan0 #where ‘wlan0’ is your wireless device


Good luck.

If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below…

It is my impression that there was a buggy update to netconfig, which might be involved. It has either been recently fixed, or soon will be fixed.

For the time being, manually enter nameservers in “resolv.conf”.

Check every now and then (say, every boot). If there is a file “/etc/resolv.conf.netconfig”, and if its content looks good, then move that to “/etc/resolv.conf”. It will be an indication that the problem is fixed.

Thank you! That forced update indeed updated my /etc/resolv.conf and brought my laptop back to the fast-lanes of internet! Hopefully this is a netconfig bug as nrickert pointed out and I’ll not have to do this very often.

Thanks for pointing it out. I’ll keep an eye out for it.

Thanks for the great suggestions and quick help that you all have been.