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'm setting up a facility with many different computers where I don't have access to their hosts files. How would I map test.com to a local server without using the hosts file? Can this be done using a simple home router?

I'd like to be able to tell guests: "If you're on our wifi, you can just go to test.com to view our local website."

I'd prefer to keep answers hardware-agnostic, but if it helps, I'm using a D-link DIR-655.

I'm aware of this answer, but I don't think it addresses these issues directly: How can I map a domain name to an IP address and port? (Am I mistaken?)

Thanks!

share|improve this question

2 Answers 2

up vote 2 down vote accepted

I haven't found a home router that can run this without using some custom firmware. However, I use the same server running the sites to host a DNS server internally at home. All the machines point to the DNS server where I have a set of custom directs set up, and all other queries are sent to my ISP's DNS server to resolve correctly. I use DHCP to assign IP's and DNS server addresses to all the clients.

share|improve this answer
    
Thanks -- that confirms my findings. Is this particularly difficult to set up? (I'm running Ubuntu server) –  Loren Rogers Mar 18 '12 at 21:43
    
There are a bunch of lightweight, simple DNS server softwares out in the world. So, setting up a DNS server can be hard or it can be easy. –  djangofan Mar 18 '12 at 21:49
    
@lrog If your using Ubuntu Server then look at DNSMasq. It's a DHCP/DNS server roled into one and I have used it successfully in the past, however spent a lot of time searching for the correct config. –  Diago Mar 19 '12 at 7:28

I would just register the domain for real and point it to a local IP address. For example, if you registered example.com and your local IP address range was 192.168.1.0/24, you could point www.example.com to 192.168.1.184 and run your web server on that IP address. While the name would resolve outside of your network, it wouldn't actually go anywhere.

If you don't want to register a domain for real, instead you can just use your own name servers that make that name resolve however you want. However, I don't recommend this because it could conflict with a real domain.

If you really want to do it by router, use a router than can support Dnsmasq. Any router that can support DD-WRT will do.

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.