Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am running Tomato software on my Asus router.

I have a service that references my home server by its internet name "home.mydomain.com". When I am away from home, it works great as it resolves via DNS to the internet facing IP, and my service is able to communicate, and tomato will port forward it to my server.

When I am at home however, it still acts the same way that it goes out to the internet facing IP. I want to configure tomato so that when I am at home, a DNS lookup for "home.mydomain.com" will instead reply with the internal IP address of my server (192.168.1.10) so that it can use my gigabit network. How can I configure this either via command line or webpage of Tomato?

share|improve this question
1  
You want split horizon DNS. I believe Tomato has BIND, if you can edit your named.conf file you can setup view directives. I could be wrong however, as I don't have such a device to test. Also, Server Fault is for professional system administrators only. This will be migrated to Super User. –  Chris S Jun 1 '12 at 23:15
1  
Why not just configure hairpin NAT so the internet facing IP works? It's fully supported by Tomato and easier to maintain. The only downside would be if you're expecting high volume traffic -- the routers' CPU or network connection may be a choke point. –  David Schwartz Jun 2 '12 at 0:39
add comment

migrated from serverfault.com Jun 1 '12 at 23:17

This question came from our site for professional system and network administrators.

1 Answer

What I've done to solve this situaiton is run my own DNS server that forwards unresolved queries to Google's public DNS (I've used OpenDNS as well) and contains A and PTR records for my own dyamic DNS name. So, from inside my network, my DNS server is used, and it resolves the name to the server's internal IP. Other queries are forwarded to Google's 8.8.8.8/8.8.4.4.

If you use a separate machine for this purpose, you need to give it a static IP and configure your DHCP to hand out that address as the DNS server.

I don't use Tomato but if it uses BIND then it's basically running a DNS server. There's other lighter-weight DNS servers than BIND.

Setting up your own DNS server will require a bit of study but if you are interested in DNS it's very educational.

share|improve this answer
    
Have you used djbdns at all? I found it a darn sight easier than BIND. –  user3463 Jun 2 '12 at 6:21
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.