Hostname

From KevinWiki

(Difference between revisions)
Jump to: navigation, search
Line 15: Line 15:
=== Update <code>/etc/hosts</code> ===
=== Update <code>/etc/hosts</code> ===
-
-Replace <code>192.168.0.111</code> with the ip address of the server.
+
# 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>blah.some-domain.com</code> with the domain name of the server.
-
-replace <code>your-domain</code> with the hostname of the server.
+
# replace <code>your-domain</code> with the hostname of the server.
  file:<code>/etc/hosts</code>
  file:<code>/etc/hosts</code>

Revision as of 09:31, 23 June 2011

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