1

my Apache server is running on Windows 7 that is my host OS for CentOs 6.4 running on vmware. In windows 7 i can access web pages (files on server) through 127.0.0.1, localhost, and alias created of the localhost in the Apache configuration but on CentOs which is my guest os i can access the host's server only through 192.168.136.1 (subnetIp of guest's NAT is 192.168.136.0), is there any way to access the server from the guest by using the alias created.

8
  • Is DNS resolving works fine on your guest OS?
    – VL-80
    Commented Aug 7, 2013 at 14:53
  • can't tell I am new to this stuff like protocols and vmware Commented Aug 7, 2013 at 15:59
  • OK. In your CentOS open terminal and execute 'cat /etc/resolv.conf'. After that execute 'nslookup alias_of_apache'. Post outputs of both commands here.
    – VL-80
    Commented Aug 7, 2013 at 17:09
  • # Generated by NetworkManager domain localdomain search localdomain nameserver 192.168.136.2 Commented Aug 7, 2013 at 17:22
  • ;; connection timed out; trying next origin Server: 192.168.136.2 Address: 192.168.136.2#53 ** server can't find alias_of_apache: NXDOMAIN Commented Aug 7, 2013 at 17:24

1 Answer 1

1

If I understood you correctly than try to do following:

Execute this command in terminal as root (on CentOS):

echo '192.168.136.1 www.gamesaint.com' >> /etc/hosts

Try to access your web site using this host name. If that works - I will give explanation why it does.

OK. Apparently it works for you. So, what is happening - you are using real hostname from Internet for internal purposes. When you try to access it from CentOS your browser performs DNS lookup procedure.

  1. It asks DNS server - what is IP address of the hostname www.gamesaint.com?
  2. And it receives answer from DNS server: The IP address of www.gamesaint.com is 208.73.210.210
  3. Now your browser connects to IP address 208.73.210.210 which is different from your local web server address.

In order to handle that we just instructed your CentOS that if it needs to communicate with www.gamesaint.com than it should use address 192.168.136.1

I hope it gives you good explanation.

2
  • thanks that worked for CentOS, but there is still a problem when i tried to associate the ip address 192.168.136.1 to the alias name by editing host file in windows Xp running on virtual box, browser in xp failed to connect after timeout Commented Aug 7, 2013 at 19:48
  • all problems cleared just used name require as alias for default gateway on xp obtained by ipconfig command into the host file. thanks again Commented Aug 7, 2013 at 20:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .