Wednesday, July 11, 2012

sudo: unable to resolve host

Just had a bundle of fun & games trying to resolve this error which I started to get on my Xubuntu 12.04 Precise. Pidgin also gave me a Facebook "Unable to authenticate: Authentication Failure"

I checked my /etc/hosts file which looked OK as follows :

127.0.0.1 localhost

127.0.1.1 John-Xubuntu

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

But if I tried to ping John-Xubuntu I got host not found.

/etc/hostname showed :

John-Xubuntu

So their was another issue at play. After mulling it over a bit I realised that the change happened whilst I was messing about with domain logons. I must have changed something and not changed it back.

On (X)Ubuntu /etc/resolv.conf is now handled automatically by resolvconf so that was unlikely to be the issue.

Next I thought I would check /etc/nsswitch.conf  This file determines where, and in what order, it looks up DNS queries. Sure enough, there was the problem. It had been renamed to nsswitch.conf.domain

I renamed it back to nsswitch.conf (after checking the contents !) and problem solved.......

Hope that helps someone !


No comments:

Post a Comment