Tuesday 15 November 2011

CentOS: Specifying DDNS hostname

A quick reminder. When using a CentOS machine on network with a DDNS then in order for the host name to appear correctly on the DDNS managed local zones, create or edit the file /etc/sysconfig/network-scripts/ifcfg-deviceID where deviceID is the actual device name of your network interface e.g. eth0, wlan0 etc. Make sure that the line DHCP_HOSTNAME appears as shown below

DEVICE="eth0"
NM_CONTROLLED="yes"
DHCP_HOSTNAME="my-machine"
NAME="System eth0"
BROADCAST=255.255.255.255
ONBOOT=yes

There can be one ifcfg-XXX file per network interface. That way you can have two different names for the same machine connecting to the same network using different network cards like Ethernet and Wi-fi.

No comments :