Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've setup a web application (http port 8080) for access over the internet. But what I'd like to do is resolve the URL locally when the user is on the LAN and only go via the internet when they are connecting remotely? However, I need to use the FQDN both internally and externally for compatibility with an application. Using the IP Address internally would cause the app to see me as a different client.

The current environment is a simple home setup for test purposes using Windows 7 in a Workgroup. As I don't have a DNS server to configure I assumed I'd be doing something in the hosts file but beyond that I'm lost!

Apologies if this is a daft question but as a developer my networking skills are shaky at best so I was hoping someone on here might be able to help me out.


share|improve this question
Is the thing you are trying to do to control the DNS name they see or the site they see?I.e. is what you are trying to do to make the user see a different site depending on where they cone from? – Jason Tan Aug 14 '10 at 13:01
No I'd like to prevent them from being routed out via the Internet when they are local. At the moment to get it working I add the ip and fqdn to the hosts file. Then when connected from a remote site where we need to come in via the internet i comment out the entry so it goes out over the web. It's this switching hosts file settings I'd like to get rid of. Hope that makes sense? – Daz Lewis Aug 14 '10 at 18:05

The normal way business of achieving this is something call split DNS.

Basically where you make your internal DNS server return the internal IP for the resource rather than the publicly available DNS records.

As you said you don't have a DNS server this won't be possible and therefore as you suggest you will need to add an entry in your hosts file.

Here are some instructions for doing so.

Hope this helps.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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