Re: "hostname" question during Debian installation
thank you for replies! So am I correct, that hostname set during the
1) mapped to an address from 127.0.0.0/8 range in /etc/hosts file
2) written to /etc/mailname
3) written to "message of the day" file
4) usually used in shell prompt(for example "\[\e]0;\u@\h:
..and this is it? Or did I miss any other uses of the "hostname"? For
some reason I always thought that hostname is definitely used by at
least other hosts in the LAN and local processing running in the
server, but turns out out was wrong(?). I mean one needs to configure
local processes(for example cupsd or snmpd) to use "hostname" IP
address if he wants to- by default they all use 127.0.0.1 which is
mapped to "localhost" in /etc/hosts file.
Kuupäeval 13. veebruar 2012 15:21 kirjutas Tom H <email@example.com>:
> On Sun, Feb 12, 2012 at 8:16 PM, Martin T <firstname.lastname@example.org> wrote:
>> During Debian installation there is a question about "hostname" using
>> expert installation mode.
> In both modes but I don't think that "regular" mode asks you for a domain.
>> Am I correct, that "hostname" inserted during Debian installation is
>> associated with a local(address from 127.0.0.0/8 range) IP address:
> If you choose "DHCP".
>> martin@martin-ThinkPad-T60:~$ hostname
>> martin@martin-ThinkPad-T60:~$ grep martin-ThinkPad-T60 /etc/hosts
>> 192.168.1.67 martin-ThinkPad-T60
>> ::1 martin-ThinkPad-T60 localhost6.localdomain6 localhost6
>> 127.0.1.1 martin-ThinkPad-T60
> You must've set a static IP address after installation because the
> installer doesn't have the "127.0.1.1" line if you set a static IP
> address within it.
>> ..and it's used by few software programs(for example Apache, MySQL),
>> but hostname is usable only locally and not reachable from any other
>> machine even inside the LAN? In addition, aren't most of the programs
>> using 127.0.0.1 address which is mapped to "localhost" in /etc/hosts
>> file not to hostname I set:
>> martin@martin-desktop:~$ sudo netstat -lnpt
>> Active Internet connections (only servers)
>> Proto Recv-Q Send-Q Local Address Foreign Address
>> State PID/Program name
>> tcp 0 0 127.0.0.1:8118 0.0.0.0:*
>> LISTEN 1233/polipo
>> tcp 0 0 127.0.0.1:631 0.0.0.0:*
>> LISTEN 1057/cupsd
>> tcp6 0 0 ::1:631 :::*
>> LISTEN 1057/cupsd
>> If yes, then changing the hostname shouldn't break any
>> services/programs associated with it?
> You're getting "127.0.0.1" in your netstat output because you're using
> the "-n" switch. Without "-n" you'll get "localhost".
> To change your hostname, check "/etc/hostname", "/etc/hosts", and
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact email@example.com
> Archive: http://lists.debian.org/CAOdoSyLF4VhByQz+Epwq3N2F-196rd6-NoGtkF_q2wuDPQaZw@mail.gmail.com