Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 06-02-2004, 04:36 AM   #1
LQ Newbie
Registered: Jun 2004
Location: Shanghai,China
Distribution: RH9.0/uclinux
Posts: 6

Rep: Reputation: 0
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.
Old 06-02-2004, 07:38 AM   #2
Registered: May 2004
Location: Montreal,QC,Canada
Distribution: Fedora Core 7
Posts: 210

Rep: Reputation: 30
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!
Old 06-02-2004, 11:04 PM   #3
LQ Newbie
Registered: Jun 2004
Location: Shanghai,China
Distribution: RH9.0/uclinux
Posts: 6

Original Poster
Rep: Reputation: 0
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?


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
hostname problem suresheva31 Linux - Networking 2 10-13-2004 12:40 AM
Newbie hostname question? ryedunn Mandriva 2 10-09-2004 04:50 AM
Newbie MySQL & Hostname issues Deeter Linux - Newbie 2 07-29-2003 09:25 PM
hostname command vs. $HOSTNAME env. variable Silly22 Linux - Networking 2 03-29-2002 06:01 PM
problem with hostname jackopa Linux - General 2 11-12-2001 03:13 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:07 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration