- Forums
- Linux Systems
- How To Change Set Hostname In Linux Debian Setting Host Name Domain
This Page Contains information about How To Change Set Hostname In Linux Debian Setting Host Name Domain By wallpaperama in category Linux Systems with 1 Replies. [2954], Last Updated: Sat May 18, 2024
wallpaperama
Sun Jul 08, 2007
1 Comments
10825 Visits
to setup the hostname in debian use these steps
for example i will be using ns1.domain.com as my hostname and domain with ip of 192.168.0.101
firs step to do is to edit /etc/hosts
nano /etc/hosts
it will look something like this:
127.0.0.1 localhost.localdomain localhost ns1
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
now change it to look like this:
127.0.0.1 localhost.localdomain localhost ns1
192.168.0.101 ns1.domain.com ns1
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
I basically added this second line: 192.168.0.101 ns1.domain.com ns1
after you have made the changes send these two commands:
Command:
echo ns1.domain.com > /etc/hostname
Command:
/bin/hostname -F /etc/hostname
if you just needed to setup your hostname stop here.
if you are continuing my tutorial, you can install your ssh now.
apt-get -f install
* i say yes to all the default prompts
once all the updates are completed:
apt-get install ssh
if you are following this Debian tutorial on install. go to the next step:
Next Step: Install BIND9
this is clearly described in the debian docs, see, e.g., 10.3 in debian.org/doc/manuals/reference/ch