Assigning host name

Issues related to configuring your network
Post Reply
itdev
Posts: 18
Joined: 2015/09/04 10:02:35

Assigning host name

Post by itdev » 2015/10/02 11:55:51

Hi everyone,
First of all good day to everyone.
I am a newbie, and having an issue which needs to get resolved immediately.

I have a site running on the linux computer in LAN. This site has to be accessed in the LAN using the host name. For example, the IP of the system running the site is 192.168.0.99 and i want to access the site by typing http://hostname/sitename in the address bar.
As someone suggested, I changed the /etc/hosts file by adding the line 192.168.0.99 sitename

The old file contains the following:

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6



The new one looks like the following:


127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.0.99 hostname


now i am able to access the site by typing http://hostname/sitename on browser on server, but not able to access the site from other computers with that url. I get the error server not available.

Please someone suggest to fix this. It is very urgent.
Thanks in advance..
Last edited by itdev on 2015/10/02 11:58:12, edited 1 time in total.

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Assigning host name

Post by TrevorH » 2015/10/02 11:57:27

You would need to add that entry to the hosts file on all the machines you wish to access the server from. Or you need to add it to your DNS server.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

itdev
Posts: 18
Joined: 2015/09/04 10:02:35

Re: Assigning host name

Post by itdev » 2015/10/02 12:06:24

Thanks for replying soon.

Except one computer hosting the site is running centos, all the other computers are running windows.

so where can I find that file on windows machine.Please help me (Also please give the same of code that has to be inserted..).

If I have a LAN of 100 computers, what will be the procedure for configuring the DNS?


Thanks in advance!

lightman47
Posts: 1522
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

Re: Assigning host name

Post by lightman47 » 2015/10/02 13:11:26

C:\Windows\System32\drivers\etc

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Assigning host name

Post by TrevorH » 2015/10/02 13:17:02

Your system admin should know the details of your DNS server (if you have one that you control).
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

MartinR
Posts: 714
Joined: 2015/05/11 07:53:27
Location: UK

Re: Assigning host name

Post by MartinR » 2015/10/02 13:55:54

Just in case the Win boxen are locked down and you can't edit the hosts file, remember that you can always use bare IP addresses in URLs: http://192.168.0.99/sitename

Post Reply