RHEL DNS and BIND Operations
DNS is a distributed decision path, not one server or one command. A client may use search suffixes, a local stub and a recursive resolver before reaching delegated authoritative servers. Cached positive and negative answers have TTLs. Before changing a zone, identify whether the server is authoritative, recursive or both, which view answered, who owns the parent delegation and how rollback will respect cache behavior.
Separate authority, recursion and client policy
An authoritative server answers from zones it serves. A recursive resolver follows delegations and caches answers for clients. Mixing open recursion with public authority creates abuse risk and a larger failure boundary. Restrict recursion to approved clients or separate roles.
Zone serials coordinate transfers. A syntactically valid record can still point to the wrong service, violate application intent or conflict with the parent delegation. DNSSEC validates signed data chains; it does not encrypt queries or prove an application endpoint is safe.
Build an evidence map
| Layer | Question to answer | Evidence |
|---|---|---|
| Client/stub | Which name, search suffix and resolver are used? | resolvectl or NetworkManager DNS state |
| Recursive cache | Which cached answer/validation state exists? | dig to intended resolver with flags/TTL |
| Delegation | Which parent NS/DS points to authority? | trace and registry/parent evidence |
| Authoritative server | Which view and zone file generate answer? | BIND config, zone validation and authoritative query |
| Application | Does returned target provide intended service? | Address/MX/TLS/application verification |
Operating sequence
- Define server role, clients, zones, views, transfer and DNSSEC ownership.
- Back up exact named configuration and zone files with permissions.
- Edit one zone through its owned source and increment serial deliberately.
- Run
named-checkconfandnamed-checkzone. - Compare candidate records with parent delegation and application intent.
- Reload the exact zone/service using a supported command.
- Query authoritative and recursive paths, including negative and DNSSEC behavior.
Commands and expected evidence
named-checkconf
named-checkconf -z
named-checkzone example.com /var/named/example.com.zone
rndc status
rndc zonestatus example.com
dig example.com SOA +norecurse @192.0.2.53
dig www.example.com A +dnssec @192.0.2.53
dig example.com NS +trace
dig example.com DS +trace
journalctl -u named --since '-30 minutes' --no-pager
ss -lntup | grep ':53'- Documentation addresses and domains are examples; use approved lab data.
+traceperforms iterative queries from the client and can differ from the configured recursive resolver path.- Validate every view or generated zone path, not only one file.
- A reload success does not prove clients receive the intended answer through caches and delegation.
Evidence and acceptance criteria
| Evidence | Healthy result | Failure meaning |
|---|---|---|
| Role/scope | Recursion and authority match design and approved clients | Open resolver or role collision |
| Zone | Configuration and zone validators pass with intended serial | Syntax/load failure |
| Delegation | Parent NS/glue/DS agree with authoritative service | Lame delegation or DNSSEC chain break |
| Response | Expected answer, flags and TTL from each relevant path | Wrong view, cache or server |
| Application | Resolved destination passes protocol and identity checks | DNS success points to unusable service |
Worked operating scenario
A DNSSEC-signed zone changes keys, but the parent DS still references the retired key. Authoritative data looks correct when queried without validation, while validating resolvers return SERVFAIL. Flushing random client caches cannot repair the chain.
The operator traces DS and DNSKEY evidence, follows the documented rollover/recovery plan with the registrar and monitors validating and nonvalidating results. Application teams receive an explicit impact window and no one disables validation globally.
Practical how-to cases
Case 1: Create an authoritative zone
Define one lab zone, validate syntax and query the local authoritative server. Separate authoritative, recursive and client-resolver roles and validate every zone before reload.
sudo named-checkconf
sudo named-checkzone example.test /var/named/example.test.zone
sudo rndc reload example.test
dig @127.0.0.1 example.test SOA +norecurse
dig @127.0.0.1 www.example.test A +norecurse| Checkpoint | What to establish |
|---|---|
| Expected result | SOA and host answers are authoritative, have the intended TTL and use the updated serial. |
| If it fails | SERVFAIL usually requires named journal, zone path, permissions, label or syntax evidence. |
| Safe recovery | Restore the saved named configuration and zone serial, run named-checkconf and named-checkzone, then reload and query locally before remote testing. |
Case 2: Add reverse DNS
Create the reverse zone that matches the lab prefix and verify PTR plus forward consistency. Separate authoritative, recursive and client-resolver roles and validate every zone before reload.
sudo named-checkzone 2.0.192.in-addr.arpa /var/named/192.0.2.rev
sudo rndc reload
dig @127.0.0.1 -x 192.0.2.10 +norecurse
dig @127.0.0.1 mail.example.test A +short| Checkpoint | What to establish |
|---|---|
| Expected result | PTR returns the intended hostname and forward lookup maps it to the same address where policy requires consistency. |
| If it fails | A PTR is delegated and controlled by the address owner; adding a private local record does not alter public reverse DNS. |
| Safe recovery | Restore the saved named configuration and zone serial, run named-checkconf and named-checkzone, then reload and query locally before remote testing. |
Case 3: Test recursion boundaries
Prove trusted clients can recurse and untrusted clients cannot use the server as an open resolver. Separate authoritative, recursive and client-resolver roles and validate every zone before reload.
dig @192.0.2.53 example.com A +recurse
dig @192.0.2.53 example.com A +norecurse
sudo rndc status
sudo ss -lnup | grep ':53'
sudo firewall-cmd --list-services| Checkpoint | What to establish |
|---|---|
| Expected result | Recursion behavior matches ACLs while authoritative answers remain available as designed. |
| If it fails | An internet-exposed open recursive resolver creates amplification and abuse risk. |
| Safe recovery | Restore the saved named configuration and zone serial, run named-checkconf and named-checkzone, then reload and query locally before remote testing. |
Case 4: Trace a DNS failure
Follow delegation and compare authoritative answer with local resolver behavior. Separate authoritative, recursive and client-resolver roles and validate every zone before reload.
dig +trace www.example.test
dig @AUTHORITATIVE_IP www.example.test A +norecurse
dig @127.0.0.1 www.example.test A
resolvectl query www.example.test 2>/dev/null || getent ahosts www.example.test
journalctl -u named -n 50| Checkpoint | What to establish |
|---|---|
| Expected result | The first delegation, authority, validation or client-cache layer that disagrees is identified. |
| If it fails | Flushing caches before recording TTL and answer state destroys useful evidence. |
| Safe recovery | Restore the saved named configuration and zone serial, run named-checkconf and named-checkzone, then reload and query locally before remote testing. |
Independent practice tasks
- Create forward and reverse lab zones with correct serial changes.
- Configure a caching-only resolver limited to one subnet.
- Break a zone syntax element and recover using validators.
- Explain NXDOMAIN, NODATA, SERVFAIL, REFUSED and timeout with one test each.
For this lesson on RHEL DNS and BIND, complete each task without copying the worked command sequence. Record the initial state, exact change, verification, negative test and recovery command. A task is unfinished if it works now but does not survive a reboot where persistence is required.
Troubleshooting by symptom
| Symptom | Inspect first | Defensible next action |
|---|---|---|
| NXDOMAIN only for short name | Search suffix/client resolver and absolute FQDN | Correct client naming or zone; do not add unrelated record |
| SERVFAIL with DNSSEC | DS, DNSKEY, signatures, time and validator log | Repair chain/rollover ownership |
| Works on authoritative, not clients | Recursive cache, delegation, views and TTL | Trace intended resolver path |
| Zone change ignored | Loaded file/view, serial and reload journal | Correct authoritative source and reload exact zone |
| Intermittent answers | All authoritative servers and replication/transfer state | Reconcile divergent zones |
Unsafe operations and recovery boundaries
- Unsafe: exposing unrestricted recursion enables reflection abuse and unauthorized use.
- Unsafe: deleting DS records or disabling validation without a controlled DNSSEC recovery plan weakens integrity and may prolong outage.
- Unsafe: broad cache flushing changes many tenants and destroys useful TTL evidence.
Rewritten knowledge checks
Guided lab and acceptance test
- Install BIND on an isolated network and restrict recursion to the lab subnet.
- Create an example authoritative zone with SOA, NS and host records.
- Introduce a syntax error and prove validators block activation.
- Correct, increment serial, reload and query authoritative/recursive paths.
- Change a record with a short TTL and observe cache aging.
- Remove the lab zone/service and verify port 53 exposure is gone.