Hostname

From KevinWiki

(Difference between revisions)
Jump to: navigation, search
(Created page with "Category:Network == Hostname == === Set Hostname === $ sudo echo "your-hostname" > /etc/hostname $ sudo hostname -F /etc/hostname If it exists, edit the file <code>/et...")
 
(2 intermediate revisions not shown)
Line 4: Line 4:
=== Set Hostname ===
=== Set Hostname ===
-
  $ sudo echo "your-hostname" > /etc/hostname  
+
  $ sudo echo "your-hostname" >> /etc/hostname  
  $ sudo hostname -F /etc/hostname  
  $ sudo hostname -F /etc/hostname  
Line 12: Line 12:
  SET_HOSTNAME='yes'
  SET_HOSTNAME='yes'
 +
 +
 +
=== Update <code>/etc/hosts</code> ===
 +
# Replace <code>192.168.0.111</code> with the ip address of the server.
 +
# Replace <code>blah.some-domain.com</code> with the domain name of the server.
 +
# replace <code>your-domain</code> with the hostname of the server.
 +
 +
file:<code>/etc/hosts</code>
 +
 +
127.0.0.1        localhost.localdomain    localhost
 +
192.168.0.111    blah.some-domain.com    your-domain

Latest revision as of 07:40, 16 December 2012

Hostname

Set Hostname

$ sudo echo "your-hostname" >> /etc/hostname 
$ sudo hostname -F /etc/hostname 

If it exists, edit the file /etc/default/dhcpcd to comment out the "SET_HOSTNAME" directive:

file: /etc/default/dhcpcd

SET_HOSTNAME='yes'


Update /etc/hosts

  1. Replace 192.168.0.111 with the ip address of the server.
  2. Replace blah.some-domain.com with the domain name of the server.
  3. replace your-domain with the hostname of the server.
file:/etc/hosts
127.0.0.1        localhost.localdomain    localhost
192.168.0.111    blah.some-domain.com     your-domain
Personal tools