LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   changing localhost (https://www.linuxquestions.org/questions/linux-newbie-8/changing-localhost-682266/)

umwai 11-09-2008 10:57 PM

changing localhost
 
I want to change localhost to a name like www.myname.com
how to do that in ubuntu

n03x3c 11-09-2008 11:11 PM

Either you edit your /etc/hosts file if you want some other name than localhost / localhost.localdomain for your 127.0.0.1 IP.

Code:

127.0.0.1        localhost    localhost.localdomain    your.host.name
Other way is to edit zones in your local DNS server. Or if you just want to set hostname, you can edit /etc/sysconfig/network file and add entry like this.

Code:

HOSTNAME=your.host.com

salter 11-10-2008 06:29 AM

It is usually good to keep the name 'localhost', so that you know when you are accessing local web server. The IP 127.0.0.1 will anyway point to the local web server.

I assume that you want to set up a public web server and are confused that your own webpages show up under localhost.

To allow for public web access you have to register the domain name, unless you want to give access IP-number. You then have to set up a virtual host in your local web server for that given domain name. If accessed by IP-number, the first virtual domain will be shown.

For virtual domains see the documentation of your web server.


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