I have a subversion source code server on my home network, and I use dyndns and my internet router to access it from the outside. When I am using my laptop, I have to use the same URL regardless of where I am (inside or outside my home network), so I modify my hosts file every time. I am looking for a way to automate this, but I don't really know what to look for.

I guess that the proper way of doing it would be to use a DNS proxy on my LAN, or to use a better internet router that could handle connections from the LAN "bouncing back" to its own public IP. But the later is not a option because my router is provided by my cable operator, and I think the DNS proxy is overkill.

edit : sorry I forgot to say I am running Windows XP

edit2 : KCotreau - here is an explanation of why modifying the Hosts file is a solution, I just want to automate it : http://www.dyndns.com/support/kb/loopback_connections.html

link|improve this question
I don't understand what you are trying to do...why do you need to edit the HOSTS file? Try adding something like this: I connect to x.mydomain.com when external, and I connect to x.mydomain.com when here. I am trying to ping X, but can't. Tell us exactly what you are doing, and what does not work rather than what you think will be the solution. – KCotreau Jun 28 '11 at 13:10
I think that xe's asking how to set up "split horizon" DNS service because xyr router is incapable of Hairpin NAT. – JdeBP Jun 28 '11 at 14:53
You can create a script that changes the HOSTS file according to the network that you are currently connected to, but that's beyond my scope. – Thiago M. Jun 28 '11 at 20:43
feedback

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown

Browse other questions tagged or ask your own question.