Hosts File

Posted on 2004-11-09
Last Modified: 2010-04-10

Is it possible to have this in a hosts file...

I want to do this so that an employee with a laptop can access our mail server internally from the ip, but if they try to connect externally, they use  Is this possible?

Question by:NeoTek
    LVL 95

    Accepted Solution

    No, it will read the first entry as the IP.  
    LVL 8

    Expert Comment

    no... if you're using dhcp to assign the laptop an address you could put the host record in your internal dns and have dhcp assign the internal dns server to the laptop...
    LVL 4

    Expert Comment

    I suggest u to put

    hope this is better what do u say...
    LVL 25

    Expert Comment

    actually you should just set up your DNS properly that way ANY of your users can get to their mail from inside or outside your lan.   If they are on your lan they should point to your internal dns server and get the internal IP.... if they are outside your lan they should point to any public DNS server and get the public IP.  This is called split DNS.
    LVL 3

    Expert Comment

    what you can do is write a 2 batfiles, place them on the desktop :

    copy C:\homehost.txt C:\WINNT\system32\drivers\etc\HOSTS

    copy C:\workhost.txt C:\WINNT\system32\drivers\etc\HOSTS

    i added also some netsh commands to change DNS changes in the WORK.bat to
    LVL 1

    Expert Comment

    I use a great piece of software that does many things beyond assigning seperate host files for different locales - mapped network drives, printers, IP address/DHCP, domain, management of multiple communication devices such as wireless or wired, vpn, etc.

    I need this software because I connect my laptop to approximately 20 different networks - as many as 4 in one day.

    It's the best piece of software I've purchased for my laptop and it wasn't tough on the wallet...      - Multi-Network Manager 7     - pricing


    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    This is an article about my experiences with remote access to my clients (so that I may serve them) and eventually to my home office system via Radmin Remote Control. I have been using remote access for over 10 years and have been improving my metho…
    Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
    Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now