Skip to content

5.2 DNS

DHCP assigns addresses, but devices still need to translate hostnames into those addresses. DNS handles this task.

DNS (Domain Name System) is a distributed, hierarchical, cached database that maps hostnames to IP addresses. Understanding the caching behavior explains why DNS changes take time to propagate and why stale records cause connectivity issues.

Each resolver caches the answer for the duration of the TTL (Time to Live) value set by the authoritative server. A TTL of 300 seconds means changes take up to 5 minutes to propagate. A low TTL propagates changes quickly but increases query load on the authoritative server. For OT device records that change infrequently, a TTL of 3600 seconds (1 hour) reduces query traffic without causing stale-record issues.

DNS stores different record types for different purposes. OT networks use most of these for device management, email routing, and reverse lookups.

RecordPurposeExample
AMaps hostname to IPv4 addresssw-cell1.plant.local → 192.168.10.1
AAAAMaps hostname to IPv6 addresssw-cell1.plant.local → fd00::1
CNAMEAlias pointing to another hostnamehistorian.plant.local → hist-srv01.plant.local
MXMail exchange server for a domainplant.local → mail.plant.local (priority 10)
PTRReverse lookup: IP to hostname1.10.168.192.in-addr.arpa → sw-cell1.plant.local
NSAuthoritative nameserver for a zoneplant.local → ns1.plant.local
SOAStart of Authority: zone metadataSerial number, refresh interval, retry interval
TXTArbitrary text (SPF, DKIM, verification)v=spf1 include:_spf.google.com ~all
SRVService location (port and host)_sip._tcp.plant.local → sip.plant.local:5060

PTR records are essential for OT network management. HiVision and other NMS tools perform reverse lookups to label devices on topology maps. A missing PTR record causes the NMS to display raw IP addresses instead of hostnames.

The dig command queries DNS servers directly and shows the full response, including TTL, authority section, and query time. dig is the primary CLI tool for DNS troubleshooting.

Terminal window
# Query an A record
dig sw-cell1.plant.local A
# Query a specific DNS server
dig @192.168.1.1 sw-cell1.plant.local A
# Reverse lookup
dig -x 192.168.10.1
# Query all record types for a domain
dig plant.local ANY
# Trace the full resolution chain from root servers
dig +trace sw-cell1.plant.local

The +trace option follows the delegation chain from root servers to the authoritative server, revealing where a resolution breakdown occurs. When the trace succeeds but a normal query is unsuccessful, the issue is in the recursive resolver’s cache or configuration.

When a server becomes inoperable and the DNS record is updated to point to a backup, clients continue using the previous IP until the cached TTL expires. A TTL of 3600 seconds means up to 1 hour of downtime after the DNS change. For services that require fast failover, set the TTL to 60 seconds before the planned change, wait for the previous TTL to expire, then perform the cutover.

The following script queries DNS records programmatically. The script is useful for verifying that switch hostnames resolve correctly across the plant network.

import dns.resolver
import dns.reversename
def dns_lookup(name: str, record_type: str = "A") -> list[str]:
try:
answers = dns.resolver.resolve(name, record_type)
return [f"{r} (TTL={answers.rrset.ttl}s)" for r in answers]
except dns.exception.DNSException as e:
return [f"ERROR: {e}"]
# Forward lookups
for rtype in ["A", "AAAA", "MX", "NS"]:
result = dns_lookup("plant.local", rtype)
print(f"{rtype:5s}: {result}")
# Reverse lookup
rev_name = dns.reversename.from_address("192.168.10.1")
print(f"PTR : {dns_lookup(str(rev_name), 'PTR')}")

The forward lookup confirms the switch resolves to the expected IP. The reverse lookup confirms the PTR record exists. HiVision uses PTR records for topology labeling.

DNS TTL controls failover speed

A low TTL propagates changes quickly but increases query load. Lower the TTL before planned cutovers, then restore the TTL afterward.

PTR records enable NMS labeling

HiVision and other tools use reverse lookups to display hostnames on topology maps. Missing PTR records show raw IPs.

Use dig +trace to find resolution breakdowns

The trace follows the delegation chain from root to authoritative server, pinpointing where resolution breaks.

Accurate DNS records depend on accurate time. When a device’s clock drifts, log timestamps become unreliable and certificate validation is unsuccessful. The next page covers NTP, the protocol that synchronizes clocks across the network.

  • RFC 1035 — Domain Names: Implementation and Specification (IETF, 1987)