PDA

View Full Version : [SOLVED] sudo unable to resolve host



InsaniaEx
May 25th, 2010, 03:08 PM
Hi, as you probably realised I am very much an Absolute Beginner. I have a few problems, but firstly I wanted to solve this one.
The problem I have, is "solved" here http://ubuntuforums.org/showthread.php?t=723361
But I pretty much tried all of that, and nothing worked, of course I may well have done something wrong.
After using the code from the second post, i get this

# Generated by Moblin Image Creator #
127.0.0.1 mark.cable.virginmedia.net localhost.localdomain localhost mark.cable.virginmedia.net
#The following lines are desirable for IPv6 capable hosts
::l ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

philinux
May 25th, 2010, 03:12 PM
cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 philcb-desktop

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


Thats mine. You could always back up your file and try a similar one to mine.

CharlesA
May 25th, 2010, 03:13 PM
If you change the hostname, you need to make sure that the hosts file has the new name.


charles@thor:~$ cat /etc/hosts
127.0.0.1 localhost
192.168.1.2 thor.asgard.lcl thor

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

Mine is different, since I've got mine set for a static IP on a server install.

The desktop says the same as philinux.

InsaniaEx
May 25th, 2010, 03:20 PM
So, something like...

127.0.0.1 localhost
127.0.0.1 mark

?

philinux
May 25th, 2010, 03:22 PM
So, something like...

127.0.0.1 localhost
127.0.0.1 mark

?


cat /etc/hostname
Will show you the hostname of the machine, mine is philcb-desktop
That goes where you got mark now.

3rdalbum
May 25th, 2010, 03:24 PM
So, something like...

127.0.0.1 localhost
127.0.0.1 mark

?

Not quite, more like:

127.0.0.1 localhost
127.0.1.1 mark

That is assuming that your hostname is "mark". Hostname is different from user name!

InsaniaEx
May 25th, 2010, 03:26 PM
Thanks, I'll try what you've both suggested.

InsaniaEx
May 25th, 2010, 03:28 PM
Tried this, made sure hostname was mark, but then when I come to save a stop alert comes up:
Could not save the file /etc/hosts
You do not have the permission necessary to save the file
Please check that you typed the location correctly and try again.

CharlesA
May 25th, 2010, 03:43 PM
How were you editing the file?

You would need to use:


sudo nano /etc/hosts

or


gksu gedit /etc/hosts

philinux
May 25th, 2010, 03:45 PM
Thanks, I'll try what you've both suggested.


cat /etc/hostname

What does this say.

InsaniaEx
May 25th, 2010, 03:46 PM
Ah, right.
Feel a tad idiotic now :)
Thanks for the help, except more problems from me soon.

CharlesA
May 25th, 2010, 03:50 PM
Problems always happen when you try something new. :-)