- Check which DHCP client are you using dhcpcd , dhclient and pump
- Remove /etc/resolv.conf file and touch a new /etc/resolv.conf Or do a cp /dev/null etc/resolv.conf
- Add an entry into /etc/sysconfig/network such that it looks as follows
- NETWORKING=yes
HOSTNAME=bacan01-l-t1
DHCP_HOSTNAME=REDHAT
where REDHAT is the new hostname - In case you are using dhclient, do the setup as follows
- Remove dhclient-eth0.leases file, which mostly resides under /var/lib/dhcp where eth0 is the interface name.
- In case you are using dhcpcd/pump, Edit /sbin/ifup script
- See if the call to dhcpcd and pump include a -h $HOSTNAME switch. If they do not, add them, so the calls looks as follows
- /sbin/dhcpcd -i $DEVICE -h $HOSTNAME
or
/sbin/pump –i $DEVICE -h $HOSTNAME - Remove all the files under /etc/dhcpc directory, like *.cache, *.org and *.info
- Remove un-neccessary entries from /etc/hosts such that it looks like
- 127.0.0.1 localhost localhost.localdomain
- Restart the network service
- /etc/init.d/network restart
or - service restart network
- Check the IP Address using ifconfig eth0
- Do a nslookup to see whether the IP points to the new hostname.
- eg. $> nslookup 155.123.33.23 It should be pointing to the new hostname.
December 15, 2006
Setting Hostname in Redhat Linux
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment