LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   hostname problem from a newbie (https://www.linuxquestions.org/questions/linux-newbie-8/hostname-problem-from-a-newbie-188745/)

simon_yang 06-02-2004 03:36 AM

hostname problem from a newbie
 
In PC 1,I write a program of CGI to change the hostname or IP address,when I change the IP address or hostname,the program modify the file /etc/sysconfig/network-scripts/ifcfg-eth0 to change IP address and modify /etc/sysconfig/network to change hostname,and I also modify the file /etc/hosts,then I use command: hostname <new_hostname> to make it realize,afte,I use service network restart to restart the services.
After these, I input the hostname in another PC's browser(such as IE,PC 2) to visit PC 1,it seems that the hostname can't be explained to actual IP address while I can visit PC 1 by inputing it's IP address,but after I reboot PC 1 everything is ok.
why?

LuggerHouse 06-02-2004 06:38 AM

OK, the hostname is changed on the PC 1. I think all this is correct. You should be able to start a browser on this machine and resolve the new hostname since it is in the /etc/hosts

Now, how would you expect the other machines to be notified if the PC 1 changed it's ip/hostname ? This is part of name resolution. There is few mechanisme to perform that depending on what Operating System your network is based. Normaly, DNS would be in charge of resolving name. So when you change your hostname/ip you should notify your DNS and make it aware of the changes.... Look into NAMED documentations to get hints on how to do this...

Good Luck!

simon_yang 06-02-2004 10:04 PM

I still can't get any hint from NAMED document,it seems that NAMED is used to set up a DNS server,and I just want to notify the existed DNS server,how can i?


All times are GMT -5. The time now is 04:05 PM.