I’ve never owned a domain name until recently and am still pretty new to this kind of stuff, so you will have to bare with me.
I have a domain, let’s say “domain.com”. This domain is registered with godaddy.com (which I am actually transferring to DynDNS).
Internally, I have two domains set up for my local network in my /etc/hosts file.
Code:
127.0.0.1 srv.domain.com srv #server
192.168.0.179 dsk.domain.com dsk #desktop
I put up a small web page on my server which has just an ‘index.html’ file and a subdirectory with another ‘index.html’ file. My domain is not registered to the correct IP address since it changes frequently and godaddy.com does not make it easy to update, so I have been accessing this page by typing my IP into the web browser.
Now, take a look at the following scenarios and let me know if this is normal behavior. (assuming the IP shown is the correct one)
1)
http://99.99.99.99 --> displays page just fine
2)
http://99.99.99.99/directory --> shows my local domain ‘srv.domain.com’ as the website address and a godaddy.com “coming soon” page is displayed
3)
http://99.99.99.99/directory/index.html --> page displays fine
4) if I then remove the ‘index.html’ part from the address when I am at the page on #3, the page will also display fine.
My question is in regards to #2 If I have never once referenced my external IP with my domain, how does it redirect to my domain, and why does it show the sub-domain I have set to my local IP (127.0.0.1). I’m not an expert in security, but it seems to me that if people have access my local domain, they have access to my local network. This bothers me for some reason. Is apache some how trying to forward to my local domain when I attempt to view the directory? If this is so, why does it not happen on example #4?
Sorry this is so long, I was trying to include as much relevant information as possible. I’ll be looking forward to everybody’s input.
Thanks for your time!
…drkstr
**edit**
corrected mistake with local IP in /etc/hosts file. The subdomain that refers to itself is set at the loopback addr, not the actual local IP. The same thing is true for the hosts file on the desktop as well:
Code:
127.0.0.1 dsk.domain.com dsk
192.168.0.101 srv.domain.com srv
I used to have it set as the actual IP of the network device but recently changed it to the loopback. I don't know if this is relevant though.
**edit**