We have a private network in office through a ADSL modem which connects to the internet. All our IP address are in the subnet 192.168.0.XX .

We have a web server running on (Centos PC ). In the vhosts configuration of apache we have named the server as myhost. I can access the http://myhost in that PC since I have also added an entry in /etc/hosts file . myhost.

But from the other PC's We are not able to access http://myhost .

I suspect this is a DNS problem .

Could anyone tell me what configurations I need to make to access http://myhost from all PC's ?

  • What DNS resolver are your PCs configured to use? Is there a local DNS server or are you using the ISPs? – Bittrance Apr 3 '11 at 7:38

Check whether you can access the webserver on through the IP itself from other system in your LAN.

If you can access webserver from other machines with IP, make appropriate entry in each system's /etc/hosts for with myhost

If other systems in your LAN are windows, make appropriate entry in C:\windows\system32\drivers\etc\hosts file.

If you don't like this method need to setup DNS server. In that case, I suggest BIND.

  • yes I can access the Ip address ( )from my MAC .But how will i edit it in /etc/hosts in MAC ? – Vidya Apr 3 '11 at 8:40
  • Check this link. It may help you. unlettered.org/2008/03/06/… – Suku Apr 3 '11 at 9:06

Out of the box CentOS is configured to have the iptables firewall running. By default it doesn't allow traffic on port 80 so you will have to enable it.

sudo /sbin/iptables -I RH-Firewall-1-INPUT -p tcp -m tcp --dport 80 -j ACCEPT
sudo /sbin/service iptables save

As Peter says, if you want to access the server by name then you will also need to add it to your name service. If you only have a small number of PCs and the changes are infrequent then it is probably easier to just add an entry in the hosts file of each one.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.