Unable to resolve Hosts

Peder

Hobbit
Joined
Oct 16, 2006
Messages
9,397
Reaction score
64
Location
Pretoria South Africa
Hi Guys

I changed my hosts file in an effort to share things but for some or other reason it keeps saying

Sudo: Unable to resolve hosts

I am getting soo pissed right now.

Thanx
Peder
 
Always make a backup copy of a global config file before editing it.

Check and see if you've made a typo somewhere in the hosts file.

Typically it should have an IP address in column 1, (from the left), and text fields in the successive columns:

Here's an arb example I grabbed from the net. In this example the guy is using aliases without the domain name. I would have the FQHN on the same line and then the alias, but that's just me. It shouldn't be a big deal for a small home network.

Code:
127.0.0.1 localhost
127.0.1.1 notebook.local notebook

192.168.0.3 media
192.168.0.8 silverbox
192.168.0.2 blackbox

# 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

Ignore the IPv6 stuff if you're not using it.
 
Last edited:
This is how it looks but its still giving me the same error...

GNU nano 2.0.7 File: /etc/hosts

127.0.0.1 localhost
127.0.1.1 peder.desktop desktop

# 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
 
127.0.1.1 peder.desktop desktop

k, I only just noticed the typo now :rolleyes:.

That 127.0.1.1 should be 127.0.0.1 or some valid private network address, e.g. 192.168.1.1 or 10.0.0.1, and then everyone else on the same LAN would have different addresses with the same format e.g. 192.168.1.x or 10.0.0.y etc.
 
its now this:
Code:
127.0.0.1 localhost
192.168.1.25 peder.desktop      desktop

# 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

and still the same thing...
 
Does the peder.desktop entry in /etc/hosts correspond with /etc/hostname?
 
FOUND IT thanx soo much, the hostname was peder-desktop and not peder.desktop

I was trying to share drives thats why i canged the hosts cause it told me too in the tutorial
 
Slackware/Slamd64, minimal customised config tools. I don't mind learning about how other distros work though :).
 
Top
Sign up to the MyBroadband newsletter
X