Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I just moved a server I was setting up from my work network to a colo. The helpful guy at the colo set up networking there, so it's working fine now.
However the hostname is messed up. At work, I named the server "antunsbox", since it was on the internal network, so /etc/hosts used to look like this (spaces have been added because the forums won't let me post anything that looks like a link):
Code:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost . localdomain localhost
192.168.1.8 antunsbox antunsbox. workdomail .com
antunsbox antunsbox
Now it looks like this:
Code:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost . localdomain localhost
123.123.123.123 domaon.com www.domain.com
#192.168.1.8 antunsbox antunsbox.workdomain.com
# antunsbox antunsbox
So I've commented out the old domain in /etc/hosts/, but what do I need to restart for it to take effect, bearing in mind I don't have full-time physical access to the server now)?
oopps sorry, i type the contents of my /etc/hosts file wrongly.
[mesut@linux mesut]$ cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 linux.domain.com linux localhost.localdomain localhost
The /etc/hosts file has nothing to do woth your hostname. The /etc/hosts file list the different hosts on your network, inkluding your own.
The hostname of your machine is set using the hostname command. This is a temporary change of hostname and has to be set in the config scripts in /etc/sysconfig/network
Change HOSTNAME=<new hostname>
I've also updated /etc/hosts and /etc/sysconfig/networking/profiles/default/resolv.conf, and removed any reference to "antunsbox".
I've restarted networking using:
/etc/rc.d/init.d/network/ restart
... and I restarted:
/etc/rc.d/init.d/named restart
(Not sure if that one had anything to do with this issue). However the machine still thinks it's called antunsbox.
Then I went into /etc/ and did:
find . -type f -exec grep -H antunsbox {} \;
... to look for any files that have antunsbox in them. A bunch in /etc/httpd turned up, some in printcap and one in mail. None of these appeared relevant. One other file turned up: /etc/detectchanges/hostname (all it contained was one word: antunsbox), but I'm not quite sure what this file is for. (I'm running Fedora Core).
If I change hostname in /etc/sysconfig/network, do I still have to change it using the command hostname?
-Antun
Quote:
Originally posted by ugge The /etc/hosts file has nothing to do woth your hostname. The /etc/hosts file list the different hosts on your network, inkluding your own.
The hostname of your machine is set using the hostname command. This is a temporary change of hostname and has to be set in the config scripts in /etc/sysconfig/network
Change HOSTNAME=<new hostname>
Red Hat's system-config-network command works for me. There are actually three palces hostnames appear:
1) On DNS tab.
2) In DHCP section of device settings.
3) The hosts file tab.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.