Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I recently convinced my room mates to cut the cord and go cable free, and they've found it pretty great so far. I'm in the process of setting up a pretty sweet, mostly automated home theater setup that revolves around an Apple TV, and part of this automation uses stuff like Sick Beard, Couch Potato, and the Transmission daemon.

I've got everything mostly working, including the web interfaces for all of the above services, but I'd like to make the URL's more friendly than <ip address>:<port number> so that my room mates, who are not technical in the slightest, can access these services (especially Couch Potato and Sick Beard). I'd like for them to be able to go to a url like movies.home or tv.home (I know that collides with a proposed TLD, if you have suggestions on this front as well I'm open) and be able to add shows to Sick Beard or put a movie on Couch Potato's watch list since those UI's are fairly straight forward to use.

I'd like for this name resolution to be done at a network wide level, so that all of our phones and laptops and whatnot can get to the web interfaces without much work or me having to go around and editing everybody's hosts file. I don't care about accessing the stuff from outside of the home network, I only want it usable from our internal network.

I'm not completely sure where to start, and I wanted to make sure I wasn't missing a simpler solution before pursuing a custom DNS server with BIND since I've never used it before and I wasn't sure if it would do what I want it to do; I was thinking that I'd set up BIND on a box somewhere in the house and then have my wireless router point to that local box as its DNS server then figure out some way to have the BIND box forward all non-home-media related requests to OpenDNS or something. Can BIND even do resolution based on different ports instead of different logical addresses? Anyway. Help is greatly appreciated.

share|improve this question
The .local pseudo-TLD is often used for this purpose, in the absence of a globally registered zone (domain) name. It isn't officially reserved, but should be "good enough" for most purposes. For additional collision resistance, add a second level domain making a fully qualified host name something like tv.dougs-home.local. – Michael Kjörling Apr 10 '13 at 12:29
@MichaelKjörling my only reservation in using mDNS is that not everything supports it. I could configure Avahi on the *nix boxes, and most of us use OS X, but as near as I can remember (it's been a while) Windows doesn't do Zeroconf/mDNS unless you install a bunch of Bonjour stuff. Unless you were just suggesting that I do regular DNS but use that as my TLD, in which case that's a pretty good idea I suppose, haha. – Doug Stephen Apr 10 '13 at 12:36
I didn't say anything about mDNS. – Michael Kjörling Apr 10 '13 at 12:36
@MichaelKjörling I know, but when most people talk to me about .local it usually turns out that they're talking about it as it works on OS X or other systems set up for mDNS since that's where it's typically used. I still should have thought of it though. Thanks for the clarification. – Doug Stephen Apr 10 '13 at 12:38
You shouldn't use .local unless you're using mDNS. I used to use .local for my home LAN; then I got a laptop supporting mDNS and things didn't work right. Now I use .lan.example.com (with a domain I registered instead of example.com). – cjm Apr 10 '13 at 14:26

First, yes, you need your own nameserver for that and bind is as good as any. Maybe a little harder to get into at first, but there are enough examples and tutorials on the internet. The advantage with bind is, that you probably won't ever miss a feature.

I suppose you are using DHCP to provide all your clients with IP Adresses and such. One of the options you can provide via DHCP is the search domain (not sure on the precise naming). Computers store this information and whenever a computer cannot resolve a name for instance movies it appends the search domain, for example home.sweet.home.org and tries again with the full name movies.home.sweet.home.org. Using your own nameserver and DHCP allows you to use short names, if that's what you're looking for.

However, you may run into problems as bind will not resolve names to a combination of ip and port. If you can't separate your web interfaces via virtual hosts (if you're using apache) you may need to give your media server multiple IPs and have those services listen on different IPs.

share|improve this answer
DHCP is provided by the router, a Cisco Linksys E4200v1; not sure how customizable it is, but I don't want to go down the Tomato route because the 5GHz builds aren't stable and I love my 5GHz. In regards to the web interfaces, I am not using any HTTP servers; the HTTP handling is baked in to the individual daemons. That said, I could probably set up a really simple nginx layer in front that does exactly what you're suggesting. Thanks for the tips, I think that knowing whether or not BIND could resolve to specific ports is a good place for me to start. – Doug Stephen Apr 10 '13 at 13:13
@DougStephen: The search domain is not an uncommon option. Even the Router I got from my ISP has this feature. – Bananguin Apr 11 '13 at 12:09

Yes, a custom DNS server serving some custom entries is the way to go. BIND is overkill for this: it's powerful but hard to configure. Dnsmasq is simple, lightweight, and widely available. It doesn't have nearly as many features as BIND but is amply sufficient for a home network. Run it on one machine that's always on, ideally your home router (which may already be running it internally, if it's Linux-based). Point all other machines to it as the sole DNS server.

How to make a machine accessible from the LAN using its hostname has some tips for setting up Dnsmasq.

share|improve this answer

Your Answer


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.