DNS turns names into addresses so that people and programs use a name such as library.settlement.internal instead of 10.1.0.5, and a settlement can run it with no connection to any outside root, because its own server is the authority for its own names. Run a name server on a machine with a fixed address, keep a second one for redundancy, give every machine its address through DHCP, and avoid the .local suffix, which many systems reserve for a different naming scheme. Start with the three names the carrier lists: library at 10.1.0.5, mail at 10.1.0.6 and council at 10.1.0.7.

Part of Networking

Running a name service for a settlement: what to serve, how to configure it, how caching affects changes, and what not to call things.

The Local Server Is The Authority, So No Outside Root Is Needed

Protocols explains DNS as a hierarchy: a resolver asks the root servers, is referred to a top-level domain server, is referred to the server that holds the domain, and caches the answer for the record’s time to live. The carrier Internet Infrastructure gives the settlement version: run BIND, or dnsmasq for simpler needs, define a zone, add the address records and point all DHCP clients at the server. The key point is that the chain stops at your own server. A client asks it, and it answers from its own data, so no root server and no other network is involved. The old global hierarchy depended on organisations that no longer exist for a village; DNS Hierarchy covers what that means and how a group of settlements builds its own.

Resource Sharing lists DNS among the shared services and adds that a local server can resolve names for machines that exist nowhere else, such as a fileserver. Records and their types are in DNS Records.

What You Need

  • A machine with a fixed address (Linux Server Setup)
  • Name-server software — dnsmasq or BIND as the carrier says
  • A list of names and addresses from the address plan (IP Addressing)
  • A domain suffix for the settlement

Method: Set Up A Settlement Name Server

Step 1: Choose the suffix carefully The carrier writes names such as library.settlement1.local. Avoid ending in .local: many systems treat .local as a separate multicast naming scheme and will not ask your server about it (general knowledge, not from the other articles). A neutral choice is .internal, which is set aside for private use (also general knowledge); check what your software expects before fixing it.

Step 2: Write the names With dnsmasq, which answers from the machine’s hosts file (general knowledge), three lines are enough, using the carrier’s addresses:

10.1.0.5   library.settlement.internal library
10.1.0.6   mail.settlement.internal mail
10.1.0.7   council.settlement.internal council

Step 3: Point every machine at it Set the name server in DHCP (DHCP). Servers, routers and the DHCP server itself use fixed addresses and, if they need names at boot, a hosts file, so that the name service is not needed to start the name service.

Step 4: Add a second server The carrier says to set up a secondary for redundancy. If the only name server is down, nothing that uses names works, though pinging by address still does.

Step 5: Test from a different machine Look a name up with nslookup or dig (general knowledge), then ping the name.

Worked Example: Changing An Address Without A Day Of Failures

The library server moves from 10.1.0.5 to 10.1.0.15. Every client and every resolver may cache the old address for the record’s time to live (Protocols: long values cut traffic, short values let changes spread quickly). Suppose the TTL is 1 hour = 3,600 s.

If you change the record at once, a client that looked it up a minute earlier keeps the old address for up to 3,600 s. To avoid the gap: (1) lower the record’s TTL to 5 minutes = 300 s; (2) wait at least the old TTL, 3,600 s, so every cached copy of the old long-lived record has expired; (3) change the address; clients now hold a stale entry for at most 300 s; (4) restore the long TTL. Total waiting time before the change: 1 hour. Maximum stale time after: 5 minutes instead of 1 hour. The example values are chosen for the arithmetic, not as recommendations.

Common Mistakes

  • One name server — a single failure takes down every name
  • A name server that needs names — give it and the DHCP server fixed addresses
  • Ending names in .local — some clients will not ask your server
  • Changing an address with a long TTL and no warning — people get the old machine for hours
  • Editing records without writing them in the address plan — names and addresses must stay in step (Network Addressing)

What’s Next

  • Learn next: DNS Records — the record types and a full zone file
  • Combine with: Mail Server — mail routing is done with DNS records