Howdy,
How do I change the hostname? In particular, what is the difference between /etc/hosts and /etc/sysconfig/network files? Where should I make the changes?
Thanks, CS.
On Mon, Jun 15, 2009 at 7:51 PM, Carlos Santananeubyr@gmail.com wrote:
Howdy,
How do I change the hostname? In particular, what is the difference between /etc/hosts and /etc/sysconfig/network files? Where should I make the changes?
Thanks, CS.
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
You should change it in both places, and then run /etc/init.d/network restart to make it effective.
/etc/hosts basically tells your own machine on which IP a certain domain resolves to. It's a "scaled down DNS server", and normally only used if you only need to maintain a few hosts on a network.
/etc/sysconfig/network tells your machine what it's actual hostname is.
All right.. So the /etc/sysconfig/network is the right place for changing hostname. The change in /etc/hosts is to map new hostname with IP address.
Thanks, CS.
On Mon, Jun 15, 2009 at 12:57 PM, Rudi Ahlers rudiahlers@gmail.com wrote:
On Mon, Jun 15, 2009 at 7:51 PM, Carlos Santananeubyr@gmail.com wrote:
Howdy,
How do I change the hostname? In particular, what is the difference between /etc/hosts and /etc/sysconfig/network files? Where should I make the changes?
Thanks, CS.
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
You should change it in both places, and then run /etc/init.d/network restart to make it effective.
/etc/hosts basically tells your own machine on which IP a certain domain resolves to. It's a "scaled down DNS server", and normally only used if you only need to maintain a few hosts on a network.
/etc/sysconfig/network tells your machine what it's actual hostname is.
-- Kind Regards Rudi Ahlers CEO, SoftDux Hosting Web: http://www.SoftDux.com Office: 087 805 9573 Cell: 082 554 7532 _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
How do I change the hostname? In particular, what is the difference between /etc/hosts and /etc/sysconfig/network files? Where should I make the changes?
/etc/hosts has nothing to do with the hostname this is just a way to resolve a name to an IP where DNS is not available or some other badness is going on
hostname is set in /etc/sysconfig/network but if you want to change it on the fly you can also echo it into /proc/sys/kernel/hostname
Tom Brown schrieb:
How do I change the hostname? In particular, what is the difference between /etc/hosts and /etc/sysconfig/network files? Where should I make the changes?
/etc/hosts has nothing to do with the hostname this is just a way to resolve a name to an IP where DNS is not available or some other badness is going on
Umm, no. There is a wierd dependency between /etc/hosts and the full qualified hostname:
You can fill in /etc/sysconfig/network your hostname full qualified but 'hostname -f' still returns without domain.
Not before you change your hosts file to: 127.0.0.1 host host.fqdn 'hostname -f' comes back wrong.
I'm wondering why e.g. the domain in /etc/resolv.conf is ignored...
Rainer