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

I have LAN setup with public server on it. The server is accessible via domain example.com. If I access example.com from within lan, it goes over my ISP. I wish it went just over my local network. Hosts file is not an option, sice most pcs are mobile and will access server both from within lan and over the internet.

The question is, are there routers capable of such redirection (low-cost, up to 50€) even if it means reflashing firmware with for example dd-wtr or is it posilble with local dns server? Or is there any completely different way?

enter image description here

share|improve this question
    
possible duplicate of Routing domain over lan –  MDMarra Oct 10 '12 at 17:43
add comment

3 Answers

up vote 4 down vote accepted

The term you are looking for is split dns.

You run an internal DNS server which all LAN clients use. It has the same records as your normal external DNS server, but for local systems it has the LAN ip address instead of the public one.

The downside of split DNS is problems with mobile clients - some will cache the LAN ip address while on the internal wifi, and when they switch to a public internet connection still keep trying to use it. My new cell phone seems to clear it's DNS cache when it switches connections, so this seems to be less of an issue for newer devices.

The other option is to enable NAT loopback in your router. Some just enable this by default, others have an option for it. Some call it by a different name. But basically it makes your router recognise that requests for it's public IP shouldn't go out to the internet, but to a local server.

The downside of NAT loopback is that all the traffic flows through your router. In most cases, this isn't an issue. But depending on how your network is setup and how powerful your router is, it could potentially cause problems.

share|improve this answer
    
Exactly what i was looking for. Thank you –  Buri Oct 10 '12 at 17:55
add comment

It probably doesn't go through your ISP, unless something is horribly misconfigured.

If there is only one router, it knows where the DMZ network is, and chooses the apropriate route, to get to the server (the direct route in case of only one router).

share|improve this answer
    
Yes, unless there are VRF's or other mechanisms for handling multiple routing tables, the traffic should be routed directly to the DMZ server by the CPE router. The route path might contain the outside ip address of the router though, and that might cause confusion. –  por Oct 10 '12 at 18:02
    
Yes, that is true, but it is hard to get a vrf-capable router for ~50eur price tag, and replacing an expensive router with a ~50eur one seemed improbable. –  mulaz Oct 10 '12 at 18:17
add comment

Yes, please use a local DNS server. That's what DNS does.

share|improve this answer
add comment

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.