You are not logged in.

#1 2011-12-15 18:46:29

Carlwill
Member
From: Orlando, FL
Registered: 2008-10-06
Posts: 560
Website

Hostname Configuration Confusion

So I've asked this before and I've also verified on the Wiki. My question is about the correct or specific configuration of how your /etc/hosts file should be formatted. I get back a few various answers and all which seem to be valid but is there no specific answer?

This is straight from the Wiki: https://wiki.archlinux.org/index.php/Be … tc.2Fhosts

Warning: This format, including the "localhost" and your actual host name, is required for program compatibility! So, if you have named your computer "arch", then that line above should look like this:

127.0.0.1   localhost.localdomain   localhost arch
192.168.1.100 yourhostname.domain.org  yourhostname

So when I follow this, my hostname looks correct when I login via my shell but when I issue the command 'hostname -f', I get localhost.localdomain. After a few minutes of troubleshooting, this is caused by the trailing 'arch' on the 127.0.0.1 line after localhost. Why does it have to be there? When I remove it, I get the correct hostname -f output and I see no networking issues at all. When I follow the Wiki instructions, the hostname -f command doesn't have the correct output. It's very explicit in the Wiki that it needs to be this way but I don't understand why. Can anyone please explain or clarify why?


./

Offline

#2 2011-12-15 19:41:01

Meyithi
Member
From: Wirral, UK
Registered: 2009-06-21
Posts: 550
Website

Re: Hostname Configuration Confusion

You are correct. if you need a fqdn you have no choice but to do it the way in which you have implied.  I myself have no problems with the following.

127.0.0.1         localhost.localdomain      localhost
192.168.1.64      158net.blahblahblah.com    Meyithi-PC

if you didn't need a fqdn, then yes you would need to put the hostname on the localhost.localdomain line, which is what the wiki is presuming.


The mind roams more freely in empty rooms.
dwm - colours - ncmpcpp - system
irc://irc.freenode.net:meyithi

Offline

#3 2011-12-16 14:02:04

Carlwill
Member
From: Orlando, FL
Registered: 2008-10-06
Posts: 560
Website

Re: Hostname Configuration Confusion

OK. Thanks. Under what circumstances would you ever not want your machine to have a correctly formatted FQDN on a network?


./

Offline

#4 2011-12-16 14:49:59

Meyithi
Member
From: Wirral, UK
Registered: 2009-06-21
Posts: 550
Website

Re: Hostname Configuration Confusion

Carlwill wrote:

OK. Thanks. Under what circumstances would you ever not want your machine to have a correctly formatted FQDN on a network?

A nameserver covers most people, but the whole hosts file thing isn't an exact art, the more you look the more conflicting info you get.

http://www.linuxquestions.org/questions … up-302189/

By the way, Arnt Gulbrandsen <agulbra@nvg.unit.no> says that 127.0.0.1 # should NEVER be named with the name of the machine. It causes problems # for some (stupid) programs, irc and reputedly talk. :^

is the exact opposite or what the arch wiki suggests for example, Arnt btw has done tcp/ip bits in kernels before today, http://arnt.gulbrandsen.priv.no/

https://wiki.archlinux.org/index.php/Co … _host_name is different from the beginners guide as well, and the slackbook http://www.slackbook.org/html/network-c … tcpip.html is somewhere in-between.

The way we seem to roll is a bit of all of them!


The mind roams more freely in empty rooms.
dwm - colours - ncmpcpp - system
irc://irc.freenode.net:meyithi

Offline

Board footer

Powered by FluxBB