Can't connect to website when I'm local on the netwrok

Hi Guys, When my laptop is connected locally on the network I can't view our website nor check my email using outlook. I modified the Host file to point to our exchange and web server, things went well ... but guess what now when I'n on the road I can't view the websit or check the email cause it is looking for an internal IP!!! is there a way that I can fix this thing without changing the HOST file back an forth ? maybe a change on DNS or something ....

Who is Participating?
plemieux72Connect With a Mentor Commented:
You need an internal DNS server (or more) to resolve internal hosts.  Your DHCP server must assign this DNS server(s) to all internal clients.  

Then, you need an external DNS server (most often not hosted by you, but by an ISP) to resolve your external hosts.

The above is called split-DNS or split-brain DNS.  In a computer's TCP/IP settings, the internal DNS servers cannot be mixed with external DNS servers and vice-versa.  When connected to the internal LAN, your queries for external hosts will be resolved by the internal DNS server.  If it does not have the host records needed in its zone, it will query the root DNS servers top down to get what it needs.  A more optimal setup to accomplish this however would be to use a couple of external forwarders in your internal DNS server config and slave (disable recursion) your internal DNS server(s) to those forwarders.  The forwarders could be your ISP's DNS servers.  This is better for security purposes as only these two servers will ever communicate with your internal server.  Note- You will need to increase the timeout in the Forwarders tab to 60 for this to work.

Here is an excellent article by Mark Minasi on what you need to get split-brain DNS setup prior to installing AD which also applies for Exchange and web servers:

Steps To Assembling The Perfect Split-Brain DNS System For Your Active Directory
Lee W, MVPTechnology and Business Process AdvisorCommented:
The host file overrides DNS.
Lee W, MVPTechnology and Business Process AdvisorCommented:
If you use DHCP at the office with DHCP assigning your DNS, then you should be fine.  On the road, your ISP assigns DNS.  If you have to, run TWO DNS servers at work, one for internal, one for external.
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to and use offer code ‘EXPERTS’ to get 10% off your first purchase.

sillcAuthor Commented:
I do use DHCP and the DNS IP that it gives is an internal one and it works well with all websites. Only ours it doesn't reognize it without editing the HOST file
You need to update the DNS records on your DNS server. Add a HOST record for your Exchange server, and a HOST record for your web server.

Remove your entries in the PC hosts file.

Once you've done that, restart your computer then try ping the server (exchange and web) by name. If it does not resolve it, make sure your DNS server setting (from DHCP) is setup correctly pointed to the DNS server you add records to.

If you can provide more details (e.g. server name and IP address for Exchange, Web, DNS, DHCP scope, etc) it will make it easier for us to give you a more descriptive suggestion.

Good Luck.


to solve the cant see the website from the local network you need to add a host record for "www" (without the quotes) to your DNS server with the IP address of your webserver.

As for can't read e-mail in outlook thats a little different, are you connecting to a server called somethign like ?
if do you need to add another host entry in your DNS, this time it'd be "mail" and the IP address of the mail server internally.

this should sort the problem,

You shouldn't have to change anything in your personal network settings or your hosts file - unless you plan to run your own DNS server on that system. DHCP is supposed to handle all off that for you and if it's not either your system's network settings are wrong or the DHCP server needs to be reconfigured.

To figure out which: If you're the only one on the LAN who can't connect to these services, take a look at someone else's network settings and make sure yours match. If nobody on your LAN can connect properly, the DHCP server needs to be reconfigured.

The reason you can't connect to these services when you're on the road is because with the hosts file entries, the system is looking for those services at internal ip addresses (which don't route through the internet for obvious reasons). If these services are internet accessible, any nameserver should be able to find them (rather, find the authoritative nameserver for them) - including your ISP's nameserver, which is why you had no problems in this regard until you edited your hosts file.

To (extremely) simplify things - click Start -> Control Panel -> Network Settings, double-click your "Local Area Connection" (don't touch the dial up connection if you have that), click "Internet Protocol (TCP/IP)" then "Properties" and make sure "Obtain IP address automatically" and "Obtain DNS server address automatically" are checked. Click OK to get out of that.

Open your hosts file and make sure the only entry is:       localhost

Forgot to mention: After you update your network settings (and you've OK'd out of the configuration screens), right-click the device in the "Network Connections" window and click "Disable". Wait a few seconds, then double click the device to reactivate it.

You may also want to:
Start > Run > cmd
ipconfig /flushdns

after doing this to clear any addresses loaded into your cache
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.