I currently have a desktop at home set up as a web server among other functions. It is running Ubuntu 12.04 and Apache 2.2.22. I have various virtual servers set up for different sites. Some of the virtual servers are for local use while others need to be accessed externally. However, right now they can all be accessed externally.

For example, I have a set of Phillips Hue lights in my house. One of the sites controls these lights. I also have sites that control other projects around the house. I want these sites to only be accessed on the LAN. Conversely, I also have instances of Gitlab and other sites I want to be able to access externally.

So, my question is: What do I have to do to isolate internal sites from the external ones? Like a local intranet for my home.

Is this handled in Apache, my domain name service, my home router? Do I need to set up a local DNS server? I would like to be able to just use a different sub-domain or directory to get to the local sites. For example, local.example.com would only be accessed on the LAN, while www.example.com would be accessed anywhere. www.example.com/local/ would also be acceptable for the local sites.


Ok, after another month of pondering and searching, I'm fairly certain this is a DNS issue. From my research, I've gathered what I think are the top two solutions. Each one requires adding the DNS records to some machine located on the network.

1. Set up a DNS server on my existing Ubuntu machine.

This way, all the DNS traffic on my local network will go through the Ubuntu machine. Dnsmasq appears to be the way to go. Then, I would set up the server to use my ISP's (or whoever's) DNS server for remote request while adding my own records for the local machines. Finally, I could use the virtual hosts in apache to resolve different subdomains to differnt sites on my web server. A seemingly good tutorial is here:


What I don't like about this method is that any remote DNS requests are reliant on my home server. It's on 24/7, but I use it for a lot of stuff, not just a web server. As a result, a certain degree of tinkering is done, and I expect it going down every once in a while from me experimenting with whatever. That being said, I'm not always home when others are home using the internet, and I don't want to leave them in the dark. So...

2. Eventually get a router compatible with DD-WRT or similar firmwares.

My current router doesn't have the capability, but I could spend a few bucks and get one with DNS functionality built in. Then, I could avoid using my server, and still have custom, internal DNS records on an always-on machine in the house. A tutorial is here:


Looks like I would just need to add my DNS records under the DNSmasq options and I would be good to go. The virtual hosts in apache would be set up the same.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.