Changing Hostname And Domain Name In Linux
Posted On Sat Nov 01, 2008 By marlin In Linux Forums And Topics Discussions For Wallpaper Websites Running On Linux Servers Forums
hay, thanks for the tutorial on how to change the domain name and hostname on a linux server which i have for my wallpaper websites.. i learned alot. so here is my version, i took notes and this is what i did. ill give you some examples:
my old server was: ns5.webune.com
DOMAIN NAME: webune.com
HOSTNAME: ns5
my new server should be: ip-208-109-209-180.ip.wallpaperama.com
DOMAIN NAME: ip.wallpaperama.com
HOSTNAME: ip-208-109-209-180
ok, so now i login to my linux machine as root, if you are not logged in as root but have root privilages, you can use the su - command. now that i have root access i send these commands:
SHELL COMMAND:
YOU WILL SEE THE FOLLOWING INFORMATION:
SO I CHANGE TO THIS:
now send this command to change to the hostname:
ok, one more thing to do, now i have to update the /etc/hosts file so send this command:
after you send the nano /etc/hosts command, you will see something like this:
now i want to change it to make it look like this for my new domain and hostnames
now its time to reboot to make all the changes take affect so i send this command:
now when the server comes up, you can see the the machine will have the new hostname, you can confirm by sending this command:
another sure way to test is to send the ping command, so i would send this command:
WARNING: please NOTE, i did this on a development machine. i would not advise you to do this on a production machine unless you know what you are doing. also, please make note that i was using red hat fedora core 7, so it might or it might now work on other distributions. i know it should work on any redhat distribution. but not sure if will work on mandrake or suse for example..
if you got another distribution and you know how to do this please let me know. or if there is another or easier way tot do this, please also let me know so we can learn from each other. im not an expert, but im posting here so hopefully it will help a newbie like me someday.
many thanks.
my old server was: ns5.webune.com
DOMAIN NAME: webune.com
HOSTNAME: ns5
my new server should be: ip-208-109-209-180.ip.wallpaperama.com
DOMAIN NAME: ip.wallpaperama.com
HOSTNAME: ip-208-109-209-180
ok, so now i login to my linux machine as root, if you are not logged in as root but have root privilages, you can use the su - command. now that i have root access i send these commands:
SHELL COMMAND:
nano /etc/sysconfig/network
YOU WILL SEE THE FOLLOWING INFORMATION:
NETWORKING=yes
HOSTNAME=ns5.webune.com
HOSTNAME=ns5.webune.com
SO I CHANGE TO THIS:
NETWORKING=yes
HOSTNAME=ip-208-109-209-180.ip.wallpaperama.com
after you have edited the changes save the changes.. i use control+x in nano. if you are using VI then you should know how to save itHOSTNAME=ip-208-109-209-180.ip.wallpaperama.com
now send this command to change to the hostname:
hostname ip-208-109-209-180.ip.wallpaperama.com
ok, one more thing to do, now i have to update the /etc/hosts file so send this command:
nano /etc/hosts
after you send the nano /etc/hosts command, you will see something like this:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 ns5.webune.com ns5 localhost.localdomain localhost
10.0.0.101 ns5.webune.com ns5
::1 localhost6.localdomain6 localhost6
as you can see from my example output, my ip is 10.0.0.101 and my host and domain name is ns5.webune.com# that require network functionality will fail.
127.0.0.1 ns5.webune.com ns5 localhost.localdomain localhost
10.0.0.101 ns5.webune.com ns5
::1 localhost6.localdomain6 localhost6
now i want to change it to make it look like this for my new domain and hostnames
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 ip-208-109-209-180.ip.wallpaperama.com ip-208-109-209-180 localhost.localdomain localhost
10.0.0.101 ip-208-109-209-180.ip.wallpaperama.com ip-208-109-209-180
::1 localhost6.localdomain6 localhost6
as you can see, i only change the domain name and the host, i left my ip address the same# that require network functionality will fail.
127.0.0.1 ip-208-109-209-180.ip.wallpaperama.com ip-208-109-209-180 localhost.localdomain localhost
10.0.0.101 ip-208-109-209-180.ip.wallpaperama.com ip-208-109-209-180
::1 localhost6.localdomain6 localhost6
now its time to reboot to make all the changes take affect so i send this command:
reboot
now when the server comes up, you can see the the machine will have the new hostname, you can confirm by sending this command:
hostname
another sure way to test is to send the ping command, so i would send this command:
ping ip-208-109-209-180.ip.wallpaperama.com
WARNING: please NOTE, i did this on a development machine. i would not advise you to do this on a production machine unless you know what you are doing. also, please make note that i was using red hat fedora core 7, so it might or it might now work on other distributions. i know it should work on any redhat distribution. but not sure if will work on mandrake or suse for example..
if you got another distribution and you know how to do this please let me know. or if there is another or easier way tot do this, please also let me know so we can learn from each other. im not an expert, but im posting here so hopefully it will help a newbie like me someday.
many thanks.
Related Content
Information
Forums »
Linux Forums And Topics Discussions For Wallpaper Websites Running On Linux Servers »
Changing Hostname And Domain Name In Linux
Linux Forums And Topics Discussions For Wallpaper Websites Running On Linux Servers »
Changing Hostname And Domain Name In Linux
Title: Changing Hostname And Domain Name In Linux
Description: Changing Hostname And Domain Name In Linux
Tags: changing ,hostname ,and ,domain ,name ,in ,linux
Info: This Post Has Been Viewed 0 Times Since
Date: Sat Nov 01, 2008
Author marlin Received 0 Replies #3034
Date: Sat Nov 01, 2008
Author marlin Received 0 Replies #3034
Share
URL: 

Embed: 

To embed this topic, just copy the code from the "Embed" box. Once you've copied the code, just paste it into your website or blog to embed it
BBCODE:: 

BBCODE is use on forums. You can put this code on all your BBCODE enabled forums like PhpBB, vBulletin® and others. Just Copy and Paste this code on your Posts and Replies on your forums
wallpaperama | Wallpapers | Forums | Terms Of Service
copyright © 2013 wallpaperama - All Rights Reserved - Last Updated Mon May 06, 2013 (-8 GMT)
Powered by: Webune Forums V5
copyright © 2013 wallpaperama - All Rights Reserved - Last Updated Mon May 06, 2013 (-8 GMT)
Powered by: Webune Forums V5