Journal karniv0re's Journal: DNS, /etc/hosts, etc.
And aside from that, my laptop is still fucked.
But anyway, the point of this journal is to help me remember common tasks I always forget how to do. For instance, setting my hostname and shit like that.
Most of this is stolen from: http://www.cpqlinux.com/hostname.html
DNS Server File
search om.cox.net
nameserver 68.105.28.11
nameserver 68.105.29.11
nameserver 68.105.28.12
Checking your Linux host name
First, see if your host name is set correclty using the following commands:
uname -n
hostname -a
hostname -s
hostname -d
hostname -f
hostname
If the above commands return correctly with no errors then all may be well; however, you may want to read on to verify that all settings are correct.
Configuring
127.0.0.1 mybox.mydomain.com localhost.localdomain localhost mybox
If you have a static IP address, then
127.0.0.1 localhost.localdomain localhost
192.168.0.10 mybox.mydomain.com mybox
Setting the Host Name using "hostname"
After updating the
hostname mybox.mydomain.com
Checking
You may or may not have the file
mybox.mydomain.com
Checking
If you have a static IP address, then
NETWORKING=yes
HOSTNAME="mybox.mydomain.com"
...
If your IP address is assigned to you by a DHCP server,
and you wish to update the local DNS server through
Dynamic DNS, then
NETWORKING=yes
HOSTNAME="mybox.mydomain.com"
DHCP_HOSTNAME="mybox.mydomain.com"
...
It makes more sense to move this "DHCP_HOSTNAME" variable
into
This is checked with the following command:
cat
/proc/sys/kernel/hostname
If you need to set this file, you can either reboot or set it now with the following command:
echo mybox.mydomain.com >
/proc/sys/kernel/hostname
Dynamic DNS
Updating the local DNS server with your host name and DHCP IP
For Red Hat Linux if you receive your IP address from a DHCP server,
you may update the local DNS server by adding the following line to
the correct ifcfg file in
DHCP_HOSTNAME="mybox.mydomain.com"
or if running Debian, edit
iface eth0 inet dhcp
hostname mybox.mydomain.com
Updated information about ddns:
Kill the dhclient process ("killall dhclient") -
make sure it is gone. Then restart networking
service network restart
For more info in Debian, see "man interfaces" and scroll down
to "The dhcp Method".
WINS
Updating the local WINS server with your host name and IP
If you wish to update the local WINS server, then use SAMBA,
and configure it to point to the local WINS server. samba.html
i.e. update the
Changing the hostname while in X-Windows
Changing the hostname while in X-Windows can be problematic.
Most often, new windows cannot be opened. Either
- Change the hostname while the X-Windows is not running
- In X-Windows change the hostname, then restart X-Windows.
DNS, /etc/hosts, etc. More Login
DNS, /etc/hosts, etc.
Slashdot Top Deals