HOWTO: Advice on the hostname to specify when installing Sabayon Linux

From Sabayon Wiki
Jump to: navigation, search
i18n: tr

Advice on the hostname to specify when you install Sabayon Linux

This article 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.

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.

Screenshot-test -Running- - Sun VirtualBox-8.png

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.

When looking at the installation screen shown above. The default for the hostname is "localhost.localdomain". Now, many people install Sabayon Linux and leave this as is. The result is that the hostname of the computer is 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 Sabayon Linux, the file /etc/hosts looks like this:

File: /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.               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:

File: /etc/conf.d/hostname

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

File: /etc/dhcp/dhclient.conf
    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". Clearly, more than one computer with the hostname "localhost" could cause problems.

Some people travel with a laptop and use wireless and wired networks in different locations, such as airports, hotels and various offices. In the latter case, they often have to connect via a proxy server. In such a situation you may have trouble with domain name resolution with a proxy server if you have left the hostname as "localhost". Many Websites list commands to change the hostname, but many do not cover all the changes required. For example, even though commands such as "hostname" return the new hostname that has been configured, the proxy server will still see the laptop's name as "localhost" if the contents of the file /etc/dhcp/dhclient.conf have not been changed. If name resolution is not working it may be possible to gain access to the Internet by entering the IP address, rather than the hostname, of the proxy server into a Web browser's networking connection settings. This is a work-around but not a final solution to the problem, which is that name resolution is not working.

If you accepted the default when installing Sabayon Linux and you later search through all the files on your computer you will find that there are many files (ASCII and binary) containing the string "localhost" (as comments in many, but not all, cases). Using "localhost" as a local alias on your computer is fine; using "localhost" as the hostname leaves you open to potential networking problems.

In 99% of cases the hostname "localhost" does not cause any problems, and you will be able to connect successfully to wired and wireless networks all over the world with Sabayon Linux using the hostname "localhost". However, 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.

It is better not to accept the default of "Set the hostname automatically via DHCP" when installing SL.

It is also better not to 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.

The best course of action 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 Sabayon Linux Wiki article HOWTO: Changing the hostname, which gives the critical changes.)

Article created by Fitzcarraldo on 16.01.09.