View previous topic :: View next topic |
Author |
Message |
sidkdbl07 Apprentice
Joined: 25 May 2003 Posts: 184
|
Posted: Sat Jul 03, 2004 7:19 pm Post subject: Computer's hostname |
|
|
Here is my /etc/hosts
Code: | 127.0.0.1 localhost smurfette
192.168.1.101 www.mydomain.com www |
but when I type hostname -f, I get
Why doesn't www.mydomain.com show up? |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54317 Location: 56N 3W
|
Posted: Sat Jul 03, 2004 7:29 pm Post subject: |
|
|
sidkdbl07,
You are looking in the wrong file.
/etc/hosts is for resolving names to IP addresses
The hostname is stored in /etc/hostname _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
kiezpro Tux's lil' helper
Joined: 13 May 2004 Posts: 126 Location: Yes
|
Posted: Sat Jul 03, 2004 7:34 pm Post subject: |
|
|
Do your /etc/hostname and /etc/dnsdomainname contain the right values? Also, I think that in /etc/hosts, it should say
Code: |
127.0.0.1 localhost smurfette
127.0.0.1 www.mydomain.com www
192.168.1.101 www.mydomain.com www |
That should do it. |
|
Back to top |
|
|
sidkdbl07 Apprentice
Joined: 25 May 2003 Posts: 184
|
Posted: Sun Jul 04, 2004 5:15 pm Post subject: |
|
|
/etc/hosts
Code: | 127.0.0.1 localhost smurfette
192.168.1.101 www.mydomain.com www |
/etc/hostname
/etc/dnshostname
|
|
Back to top |
|
|
kiezpro Tux's lil' helper
Joined: 13 May 2004 Posts: 126 Location: Yes
|
Posted: Sun Jul 04, 2004 6:37 pm Post subject: |
|
|
Your /etc/hosts is lacking the second entry for 127.0.0.1 that should point to www. yourdomain.com (like in my example above) - that should be it. |
|
Back to top |
|
|
sidkdbl07 Apprentice
Joined: 25 May 2003 Posts: 184
|
Posted: Mon Jul 05, 2004 3:19 pm Post subject: |
|
|
My /etc/hosts
Code: | 127.0.0.1 localhost smurfette
127.0.0.1 www.mydomain.com www
192.168.1.101 www.mydomain.com www
|
... and when I type hostname -f is still outputs localhost
Any ideas? |
|
Back to top |
|
|
mike4148 l33t
Joined: 09 Sep 2003 Posts: 641
|
Posted: Mon Jul 05, 2004 3:29 pm Post subject: |
|
|
Either run
or
Code: | /etc/init.d/hostname restart |
(note: if hostname is in the boot runlevel, that will restart a lot of stuff)
or reboot your computer (don't do that, please ). The hostname isn't dynamically read from /etc/hostname; it's set by hostname, in Gentoo via the hostname init script. |
|
Back to top |
|
|
sidkdbl07 Apprentice
Joined: 25 May 2003 Posts: 184
|
Posted: Tue Jul 06, 2004 6:18 pm Post subject: Computer's hostname [SOLVED] |
|
|
My /etc/hosts
Code: | 127.0.0.1 localhost
192.168.1.101 smurfette.wickedev.com smurfette
|
Restarted hostname and all is peachy. Thanks for the help. |
|
Back to top |
|
|
|