Warning regarding the hostname when installing Sabayon Linux

Installer Issues via Installer -- Not for global upgrades or upgrading individual packages -- ONLY ISSUES WITH INSTALLATION OF THE OS -- Can't get Sabayon installed, than post here, otherwise use correct forums

Moderator: Moderators

Warning regarding the hostname when installing Sabayon Linux

Postby Fitzcarraldo » Fri Jan 16, 2009 18:22

This post is aimed at people who want to install Sabayon Linux on a computer for use on a wired or wireless network. It is especially relevant to laptop users who roam. The purpose is to warn people of a potential problem if you select the default hostname.

When you reach the following screen in the installation process you are asked to enter a name for your computer, or to accept a default.

Image

The technical term for this computer name is 'hostname', and one of its uses is to identify your computer on other computers and network equipment (routers etc.) on a network.

Look under the 'Computer name' heading on the installation screen shown above. The default for the hostname is "Set the hostname automatically via DHCP". Now, I have installed SL many times and left this as is. The result was that the hostname of my computer was made "localhost". Not just the alias, you understand, which is also "localhost" and can be left as such, but the actual hostname of the computer.

If you accept the default when you install SL, the file /etc/hosts looks like this:

Code: Select all
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               localhost localhost.localdomain localhost

# IPV6 versions of localhost and co
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
fff02::2 ip6-allrouters
ff02::3 ip6-allhosts


the file /etc/conf.d/hostname looks like this:

Code: Select all
HOSTNAME="localhost"


and the file /etc/dhcp/dhclient.conf looks like this:

Code: Select all
send host-name "localhost";
supersede host-name "localhost";

i.e. your computer is telling other nodes (computers, routers etc.) on the network that it is called "localhost". However, other devices are also likely to have an alias "localhost". See where I'm going with this?

I travel a great deal with my laptop, and use wireless and wired networks in many places, such as airports, hotels and different clients' offices. In the latter case, I very often have to connect via a proxy server. Recently I had trouble with domain name resolution with a proxy server, and the IT support staff noticed that my laptop's hostname in the domain name server was listed as "localhost", and the IT support staff requested me to change it, as telling other computers your hostname is "localhost" can cause problems getting connected. So I changed it, or at least tried to. Even though commands such as 'hostname' returned the new hostname I had configured, the proxy server was still seeing my laptop's name as "localhost" (it was only later that I found that the culprit was the file /etc/dhcp/dhclient.conf, which still specified the hostname as the default "localhost"). Anyway, as name resolution was not working, I finally managed to get onto the network by entering the IP address, rather than the hostname, of the proxy server into the Firefox networking connection settings. This was a work-around, but not a final solution to the problem, which was that name resolution was clearly not working.

If you accepted the default when installing Sabayon Linux and you later search through all the files on your computer you'll discover that there are hundreds of files (ASCII and binary) containing the string "localhost" (as comments in many, but not all, cases) and I'm still not entirely sure I've managed to eradicate the hostname "localhost" entirely. Using 'localhost' as a local alias on your computer is fine; using 'localhost' as the hostname leaves you open to potential networking problems.

I should point out that in 99% of cases the hostname 'localhost' does not cause any problems, and I have successfully connected to wired and wireless networks all over the world many times with Linux over the last couple of years. However, I'm giving you a 'heads up' that it is sensible to avoid using "localhost" as a hostname (as distinct from alias), because you may run into trouble somewhere if you connect your computer to a network.

I recommend that you do not accept the default of "Set the hostname automatically via DHCP" when installing SL.

I also recommend that you do not select the alternative "manually" and just leave the default "sabayonx86" or "sabayonx86_64" that is in the input box, because if you install SL onto other computers on the same network they could then all have the same hostname (e.g. "sabayonx86"). This would still be better than a hostname of 'localhost', but still could cause problems for dynamic name resolution on some networks.

So my advice to you is to select "Set the hostname manually" and enter a hostname that you think is unlikely to occur on other computers, routers etc. on your network or on other networks when you are roaming. You can choose anything you want (e.g. "sabayonx86dave", "slx86john", fred911", "davepcno2" or whatever).


(If you have already installed SL and now want to change your hostname, see the SL Wiki article HOWTO: Changing the hostname, which gives the critical changes I know about so far.)


EDIT: Added as an article in the SL Wiki: http://wiki.sabayonlinux.org/index.php? ... ayon_Linux
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 7985
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: Warning regarding the hostname when installing Sabayon Linux

Postby wolfden » Fri Jan 16, 2009 22:50

Thanks Fitzcarraldo, great advice

Some packages will actually fail to install if you leave it default even
wolfden
Sharecropper
 
Posts: 9051
Joined: Sat Jan 14, 2006 0:55
Location: Midwest USA

Re: Warning regarding the hostname when installing Sabayon Linux

Postby styla » Sat Jan 17, 2009 12:48

yep. considering this, I'd actually suggest changing the default to giving a specific default hostname. most private users will not have a dhcp server which gives sensible hostnames to clients, but are lucky if they get assigned ip addresses... imho, the resulting "[email protected]" is somewhat stupefying.
styla
Baby Hen
 
Posts: 9
Joined: Sat Dec 02, 2006 23:04

Re: Warning regarding the hostname when installing Sabayon L

Postby Fitzcarraldo » Thu Feb 03, 2011 1:45

The Installer screen may be different these days (see below), but the advice still remains the same! Make the hostname as unique as possible. And, unlike the guy below, I recommend you do not have a hyphen in the hostname: some routers don't like it. My advice is to stick to alphanumeric characters only.

Image
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 7985
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: Warning regarding the hostname when installing Sabayon L

Postby Selexo » Sun Apr 10, 2011 3:42

Shouldn't the hostname be generated randomly by the installer.. At least I thought this was done on most systems.
Selexo
Baby Hen
 
Posts: 16
Joined: Fri Aug 13, 2010 8:49

Re: Warning regarding the hostname when installing Sabayon L

Postby Fitzcarraldo » Sun Apr 10, 2011 8:35

^Nope. Random generation of a hostname is not a good idea either. It's better that the user specifies a hostname.
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 7985
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: Warning regarding the hostname when installing Sabayon L

Postby penguin_unix » Thu Aug 28, 2014 0:16

...mmm...more than 3 years this caveat...is still valid?
penguin_unix
Baby Hen
 
Posts: 7
Joined: Wed Aug 27, 2014 22:15

Re: Warning regarding the hostname when installing Sabayon L

Postby Fitzcarraldo » Thu Aug 28, 2014 20:56

penguin_unix, As I wrote on Feb. 3, 2011 in my second post in this thread, the installer may be different these days, but my advice to make the hostname unique per installation still holds true.

At least the SL Installer does not use a default hostname of "localhost" any more, but it still does not set a good hostname, as it is too samey. Here is what the text installer configured by default a couple of days ago when I installed SL from a Daily ISO:

Code: Select all
[email protected] ~ $ su
Password:
sabayon fitzcarraldo # hostname
sabayon.local
sabayon fitzcarraldo # uname -a
Linux sabayon.local 3.16.0-sabayon #1 SMP Sun Aug 17 11:05:31 UTC 2014 x86_64 Intel(R) Core(TM) i7 CPU Q 720 @ 1.60GHz GenuineIntel GNU/Linux
sabayon fitzcarraldo # hostname -f
hostname: Unknown host
sabayon fitzcarraldo # hostname -a
hostname: Unknown host
sabayon fitzcarraldo # hostname -d
hostname: Unknown host
sabayon fitzcarraldo # sysctl kernel.hostname
kernel.hostname = sabayon.local

Not good, is it? If you have two or more machines on your network using the same hostname ("sabayon.local") it is not a good idea. So my advice remains: specify your own hostname, and choose something that is likely to be unique. Actually, on my main laptop I chose a hostname that is memorable to me but distinctive, and in the numerous different companies' networks around the World to which I have connected my laptop over the last few years, I have not come across the same hostname as mine yet. Once bitten, twice shy (as the saying goes).

Anyway, I think I will 'un-sticky' this thread, as the default hostname is at least no longer "localhost". But folk should be aware that using a default of "sabayon.local" is almost no better if you will have more than one machine on your home network running SL with the same default hostname, or your will connect to another network where some other users could be running SL with the same default hostname. Choose a different, memorable username that is unlikely to be used by someone else.
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 7985
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom


Return to Installer Issues - Calamares **Not for Package Manager Stuff**

Who is online

Users browsing this forum: No registered users and 1 guest

cron