Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I was hoping to know if there is a way to direct all traffic to a specific url, to the server it corresponds to on our local network with out having to go out into the internet. It would be way more convenient for the system we have set up here.

Please and thank you.

share|improve this question

migrated from superuser.com Jul 30 '10 at 18:56

This question came from our site for computer enthusiasts and power users.

    
May be a better question for ServerFault.com (which is about administration) but I'll give you a client-pc level answer. –  JNK Jul 30 '10 at 18:30
    
If your job description is "sysadmin", there is a good chance you should ask your question on Server Fault, where it will be more adapted. I'm migrating your question there. –  Gnoupi Jul 30 '10 at 18:56

4 Answers 4

up vote 2 down vote accepted

The way I've done this in the past is by running an internal DNS server that has similar DNS "lookup" zones as the internet, but it simply has local (non-routable) IPs listed.

Then via DHCP, you assign all users to use this DNS server, which will always give out LAN IP addresses for servers you specify.

share|improve this answer
    
I would like to avoid setting up a dns server for just one url, that I am trying to get routed to server on our local system. I know routing tables can do this just wanted to maybe get some director before looking into the configuration of my switch. –  garbagecollector Jul 30 '10 at 19:36
2  
@Garbgecollector: Your Ethernet switch isn't going to do what you're looking for. Your best bet is to put up a DNS server on the LAN as Nate Bross recommends. –  Evan Anderson Jul 30 '10 at 20:49

First of all, that switch is a Layer 2 switch, not a Layer 3 (router) switch, so it's not going to be able to do any routing at all let alone static routes (which is what I think you were implying in your question, and wouldn't work anyways).

Secondly, what you're asking for is commonly called split DNS: example.com resolves to an internal IP address when the request originates on the "inside", usually against your internal DNS server.

If you don't have an internal DNS server, your edge router may be able to do DNS proxying and in turn may allow you to setup a static DNS entry (essentially acting as your DNS server). However, alot of consumer-grade router/firewalls will assign the DNS servers the router gets from the ISP, which doesn't really help in your case, as your machines on your LAN would be querying the ISP's (or whatever you have entered in as your DNS servers in your router) DNS servers directly.

You could get away with editing everyone's hosts file and adding the IP and the domain you want to resolve to it, but that obviously gets a bit harder to manage the more machines you have.

I'd highly recommend setting up a DHCP/DNS server internally; it'll give you more control, allow you to do caching (making the Internet feel quicker for regularly-querying DNS records), and split DNS as I've described. Any old workstation will do running Linux of your choice and DNSMasq.

share|improve this answer

If this is for Windows systems, you can edit the hosts file on the client terminals in

c:\windows\system32\drivers\etc

To redirect the url to the internal ip address. This file can be copied from PC to PC.

share|improve this answer
    
I have a switch that should be able to handle this feature. because if we set these on system laptops. they will lose the regular url link. –  garbagecollector Jul 30 '10 at 18:49
    
Gotcha. I would ask on serverfault.com, since that's the site for admin stuff like this. –  JNK Jul 30 '10 at 18:55

This is not switching, but can be accomplished via DNS as already stated or with a router that can handle "loopback" functionality (if this is all within a single IP network). Information on the network and router configuration is needed to determine if routing loopback is appropriate and/or possible (based on the router being used - hint: a lot of SOHO NAT routers will not work).

share|improve this answer

Your Answer

 
discard

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.