sudo works, but says 'unable to resolve host' - AVS Forum | Home Theater Discussions And Reviews
Forum Jump: 
 
Thread Tools
post #1 of 6 Old 09-07-2008, 09:30 PM - Thread Starter
Senior Member
 
Daravon's Avatar
 
Join Date: Mar 2006
Posts: 307
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
My machine is named brutus, and a while back I had some trouble with diagnosing my DSL connection. I don't know what I did but now when I sudo, it always says 'unable to resolve host brutus'. The sudo works, however. It seems like ever since then my xserver has been being flaky....adept notifier in particular. Any ideas what my hamfisted keyboard pounding might have messed up? If nothing else, the warning is annoying.
Daravon is offline  
Sponsored Links
Advertisement
 
post #2 of 6 Old 09-08-2008, 08:18 AM
AVS Forum Special Member
 
MichaelZ's Avatar
 
Join Date: Sep 2000
Posts: 1,749
Mentioned: 1 Post(s)
Tagged: 0 Thread(s)
Quoted: 59 Post(s)
Liked: 27
This problem is usually caused by some problem or omission in your hosts file.
Try adding something like this to your /etc/hosts file


127.0.1.1 hostname:domain hostname

or simply in your case:
127.0.1.1 brutus

Also you cause use gksu instead of sudo to edit the hosts file.
MichaelZ is offline  
post #3 of 6 Old 09-08-2008, 01:15 PM
Senior Member
 
SeijiSensei's Avatar
 
Join Date: Sep 2007
Location: Metro Boston
Posts: 465
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
Quote:
Originally Posted by MichaelZ View Post

Try adding something like this to your /etc/hosts file
127.0.1.1 hostname:domain hostname

You should be using 127.0.0.1 for that address, which is the default "localhost" address that every computer using TCP/IP includes. If you know the IP address associated with your ethernet adapter, you can use that instead.

Most every Linux computer already has an entry in /etc/hosts for the localhost address which usually looks something like

Code:
127.0.0.1     localhost     localhost.localdomain
The "localhost.localdomain" entry may or may not be present depending on your choice of distribution. Just edit the line so it reads

Code:
127.0.0.1    localhost     localhost.localdomain brutus
which makes "brutus" an alias for "localhost". The syntax is

IP_address hostname [optional aliases like above]

You must be the "root" (administrative) user to do this since ordinary users cannot edit the hosts file.
SeijiSensei is offline  
Sponsored Links
Advertisement
 
post #4 of 6 Old 09-08-2008, 01:39 PM
Senior Member
 
mym6's Avatar
 
Join Date: May 2006
Location: North Dakota
Posts: 427
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 1 Post(s)
Liked: 10
I agree with the others. You need to add brutus to your hosts file in the 127.0.0.1 line OR if you have a static IP address on that machine then add a new line with that IP address and brutus after it
mym6 is offline  
post #5 of 6 Old 09-08-2008, 03:05 PM - Thread Starter
Senior Member
 
Daravon's Avatar
 
Join Date: Mar 2006
Posts: 307
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
OK I added the alias brutus to the end of the line, but mine still looks a bit different than the suggestions here. Maybe because I'm using Ubuntu. The sudo warning is thankfully gone; I'll have to see if my xserver flakiness goes away.


Code:
127.0.0.1 localhost brutus

# 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
ff02::3 ip6-allhosts
/etc/hosts (END)
Daravon is offline  
post #6 of 6 Old 09-08-2008, 05:14 PM
AVS Forum Special Member
 
MichaelZ's Avatar
 
Join Date: Sep 2000
Posts: 1,749
Mentioned: 1 Post(s)
Tagged: 0 Thread(s)
Quoted: 59 Post(s)
Liked: 27
This was changed in the beta of Hardy (when I was having sudo issues) and this subject came up. I think it started around edgy, anyway here it is from the debian ref.


From Debian Reference:

10.4 Domain Name Service (DNS)

Hosts are referred to by domain name as well as by IP address. DNS is a client-server system in which name resolvers consult nameservers in order to associate domain names with IP addresses and other properties of hosts. The GNU C Library resolver(3) can also look up IP addresses in files or consult Network Information Services (NIS).
Some software (e.g., GNOME) expects the system hostname to be resolvable to an IP address with a canonical fully qualified domain name. This is really improper because system hostnames and domain names are two very different things; but there you have it. In order to support that software, it is necessary to ensure that the system hostname can be resolved. Most often this is done by putting a line in /etc/hosts containing some IP address and the system hostname. If your system has a permanent IP address then use that; otherwise use the address 127.0.1.1.
127.0.0.1 localhost
127.0.1.1 uranus
To see whether your system hostname can be resolved to an IP address with a fully qualified domain name, use the hostname --fqdn command.
MichaelZ is offline  
Sponsored Links
Advertisement
 
Reply HTPC - Linux Chat

Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page


Forum Jump: 

Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off