This is the Hosts file from my working Gentoo installation. I've removed the actual routing instructions, in favor of the comments. More on the routing momentarily:
# /etc/hosts: Local Host Database
# This file describes a number of aliases-to-address mappings for the for
# local hosts that share this file.
# In the presence of the domain name service or NIS, this file may not be
# consulted at all; see /etc/host.conf for the resolution order.
# Imaginary network.
# According to RFC 1918, you can use the following IP networks for private
# nets which will never be connected to the Internet:
# 10.0.0.0 - 10.255.255.255
# 172.16.0.0 - 172.31.255.255
# 192.168.0.0 - 192.168.255.255
# In case you want to be able to connect directly to the Internet (i.e. not
# behind a NAT, ADSL router, etc...), you need real official assigned
# numbers. Do not try to invent your own network numbers but instead get one
# from your network provider (if any) or from your regional registry (ARIN,
# APNIC, LACNIC, RIPE NCC, or AfriNIC.)
Notice the last comment block regarding private networks. What most people forget when configuring network services for their private network is that there is an imaginary line that splits their internal network (Those IP Addresses covered by RFC 1918, and RFC 6761), and the external network (the Internet for all practical purposes), where the domain IP Addresses are mostly maintained and updated by the Internet Assigned Numbers Authority, aka the IANA. This is also the accepted practice because the IANA is in charge of the DNS Root Zone, The IANA DNS Server has the final say in where a domain resolves to. Imagine your DNS server as the top branch of a tree. If your Server can't resolve a host, your request is sent down the tree, to subsequent branches. Each branch grows in size At the bottom of the tree is the IANA DNS Server.
It's up to the maintainer/creator of the private network to handle routing inside the private network. In Linux this is done by updating the hosts file, usually stored at
/etc/hosts Please note that the OP had only solved half the problem by installing and configuring BIND. BIND properly routes names to hosts and hosts:ports and the other way around. In most servers, one of it's many uses is to bind an external DNS zone (one outside your private network) to an internal DNS zone. See Linux DNS server BIND configuration for more on this. I'll also be referring back to that link when certain sections below warrant.
Since routing internally is governed by different rules (RFC 1918/6761), one must setup static routing so that the address-to-name mappings work in BIND. If the
etc/hosts file isn't configured for this, the bind mapping only knows to route the request internally, but not where to route it to. In order to fix this we must add our local mapping (assuming the OP has set the external BIND mapping correctly):
# IPv4 and IPv6 localhost aliases
127.0.0.1 bedroom-gentoo.myISP.net bedroom-gentoo localhost
::1 bedroom-gentoo.myISP.net bedroom-gentoo localhost
and then our local resolution (in the OP's case)
192.168.1.x sickbeard.plug.example.com sickbeard.plug sickbeard
192.168.1.x dl.plug.example.com dl.plug download
# Add others as needed.
Notice that the private network resolution above can resolve to the FQDN, plus only the host names. The OP and others can adjust this accordingly for the desired behavior. I find that using the FQDN inside the private network is easier than remembering all the host names created.
Step 2 - Optional but Preferred
I'm adding the links below, as readers will see this networking term in most answers connected to network setup. If you're new here, have a read. If you've been around awhile, you may want to skip.
As you can see after reading or not, DHCP is very good at what it does. It's main function from here to eternity will be to give out addresses, whether Public or Private. What DHCP is not good at is remembering the addresses it gives out may actually belong to a server of any sort. In the OP's case, and many other readers, this is the case. That case applies here, as we have "software reserved" the IP address
192.168.1.x to the
plug device. In order to make sure that DHCP doesn't stupidly override the server's address after a reboot/restart or power outage, one should use MAC Address Binding in one's router. I took the following screenshot from my Motorola Surfboard, but I've seen the same type of entry screen in most major router brands (D-LINK, NetGear, LinkSys/Cisco). Also, some may name it Reserve, some name it Binding, some MAC Binding:
The MAC Address of the server,
plug in the OP's case would go in the first box, and the last octet, x from the
/etc/hosts file would go into the IP Address box. I believe the Host Name is filled in automatically, but you could use a name from
etc/hosts if wanted. This will ensure that we will never have to modify our hosts file because we are forcing DHCP to hand out a Static IP Address. On a side note, this may slightly increase caching of streaming media services. I've used the same concept for my Roku device before.
How TCP/IP Works - Youtube