Hosts File


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?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Lee W, MVPTechnology and Business Process AdvisorCommented:
No, it will read the first entry as the IP.  

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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...
I suggest u to put

hope this is better what do u say...
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

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.
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
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

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

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.