Configuring DNS in AIX
— ny_wk

Configuring DNS in AIX means setting up the BIND named daemon to answer name lookups so your IBM Power LPARs can resolve hostnames to IP addresses (and back) without depending on an external resolver. This guide walks through building a primary (master) DNS server on AIX from scratch: the /etc/named.conf file, forward and reverse zone files, starting the daemon with the SRC, and verifying everything with dig.
AIX ships BIND as part of the base operating system, so no extra package install is normally required. The steps below produce a small authoritative server for the example domain my.example.com on the 192.168.1.0/24 network, and they correct several common mistakes that float around older AIX DNS notes.
The problem: AIX name resolution without a DNS server
Out of the box an AIX LPAR resolves names using /etc/hosts (and whatever /etc/resolv.conf points to). That is fine for one or two machines, but as soon as you have several LPARs, NIM clients, or application tiers that talk to each other by name, maintaining a flat hosts file on every box becomes error-prone. A local DNS server gives you one authoritative place for forward (name to IP) and reverse (IP to name) lookups.
The solution is to run the BIND name server, whose daemon on AIX is named, managed by the System Resource Controller (SRC). You define your zones in /etc/named.conf, write the records in zone files under /var/named, start the daemon, and point clients at it.
What you need before you start
- Root access on the AIX LPAR that will become the DNS server.
- A static IP for the server (this example uses
192.168.1.1). - A chosen domain name (here
my.example.com). - The BIND fileset installed (it is part of
bos.net.tcp.client/bos.net.tcp.serveron most AIX levels). Confirmnamedexists withwhich namedorlssrc -s named.
Step-by-step: configure the DNS server in AIX
Follow these steps in order. Every command is run as root. Substitute your own domain, network, and IP addresses for the example values.
- Set a fully qualified hostname. A name server should identify itself by its FQDN. Set it for the running session and make it persistent across reboots:
- Temporary:
hostname lpar1.my.example.com - Persistent:
chdev -l inet0 -a hostname=lpar1.my.example.com
- Temporary:
- Create the zone-file directory. BIND on AIX expects its zone files in a working directory;
/var/namedis the conventional choice:mkdir -p /var/named - Create
/etc/named.conf. This is the master configuration file. It lists the working directory plus one stanza per zone — a forward zone, a reverse zone for your subnet, a reverse zone for loopback, and the root hints. Open it withvi /etc/named.confand enter:options {directory "/var/named";};zone "my.example.com" {type master;file "named.my.example.com";};zone "1.168.192.in-addr.arpa" {type master;file "named.192.168.1";};zone "0.0.127.in-addr.arpa" {type master;file "named.local";};zone "." {type hint;file "named.ca";};
Use straight ASCII quotes ("), not curly typographic quotes — BIND will refuse to parse smart quotes. The reverse-zone name1.168.192.in-addr.arpais the network192.168.1written backwards, which is how PTR lookups work. - Create the forward zone file
/var/named/named.my.example.com. This holds the SOA, the NS record, and the A (address) records that map names to IPs:$TTL 86400@ IN SOA lpar1.my.example.com. root.my.example.com. (2009010901 ; Serial3600 ; Refresh300 ; Retry360000 ; Expire86400 ) ; Minimum / Negative-cache TTL@ IN NS lpar1.my.example.com.lpar1 IN A 192.168.1.1lpar2 IN A 192.168.1.2lpar3 IN A 192.168.1.3
The trailing dot on fully qualified names is mandatory:lpar1.my.example.com.is absolute, whilelpar1without a dot is treated as relative to the zone origin. - Create the reverse (PTR) zone file
/var/named/named.192.168.1. Note the filename must match thefiledirective you set in step 3. PTR records map the last octet of each address back to a hostname:$TTL 86400@ IN SOA lpar1.my.example.com. root.my.example.com. (2009010901 ; Serial3600 ; Refresh300 ; Retry360000 ; Expire86400 ) ; Minimum@ IN NS lpar1.my.example.com.1 IN PTR lpar1.my.example.com.2 IN PTR lpar2.my.example.com.3 IN PTR lpar3.my.example.com. - Create the loopback reverse file
/var/named/named.localso reverse lookups of127.0.0.1resolve cleanly:$TTL 86400@ IN SOA lpar1.my.example.com. root.my.example.com. (2009010901 3600 300 360000 86400 )@ IN NS lpar1.my.example.com.1 IN PTR localhost. - Create the root-hints (cache) file
/var/named/named.ca. For lookups outside your own zones, the server needs to know where to start. On an Internet-connected server, populate this with the real root servers (dig . NS > /var/named/named.ca, or fetchhttps://www.internic.net/domain/named.root). For an isolated lab that simply forwards everything upstream, point at your gateway resolver instead:. IN NS ns.example.com.ns.example.com. IN A 192.168.0.1
For a closed network it is usually cleaner to add aforwarders { 192.168.0.1; };line inside theoptions {}block innamed.confrather than faking root hints. - Start the named daemon and confirm it is active. AIX uses the System Resource Controller, not
systemctl:startsrc -s namedlssrc -s named
The status should showactive. To startnamedautomatically at every boot, make sure the entry in/etc/rc.tcpipis uncommented (start /usr/sbin/named "$src_running"). - Test resolution with
dig. Query the server directly atlocalhostfor a forward A record and for the reverse PTRs:dig @localhost lpar1.my.example.com Adig @localhost -x 192.168.1.1dig @localhost -x 127.0.0.1
You can also write the reverse name out longhand:dig @localhost 1.1.168.192.in-addr.arpa PTR. In each case the data you want appears in the ANSWER SECTION; the AUTHORITY/ADDITIONAL sections are normal background detail and can be ignored. - Make the server a client of itself. Once the queries return correct answers, point the box at its own resolver by editing
/etc/resolv.conf:domain my.example.comnameserver 192.168.1.1nameserver 192.168.1.2
Add the samenameserverlines to every client LPAR that should use this DNS server. Names now resolve to IPs across your network.
Common pitfalls when configuring DNS in AIX
Most failed AIX BIND setups come down to a handful of recurring mistakes. The original procedure this guide is based on contained several of them, so they are worth calling out explicitly.
- Curly/smart quotes in
named.confor zone files. If you copy configuration from a word processor or web page,“and”sneak in. BIND only accepts straight quotes. Retype them invi. - The bogus TTL value
9999999. Older notes show9999999in front of every record. That is not a valid per-record TTL convention — use a sensible$TTLdirective at the top of each zone (for example$TTL 86400for one day) and let records inherit it. - Zone filename does not match the
filedirective. Ifnamed.confsaysfile "named.192.168.1";the file on disk must be exactly/var/named/named.192.168.1. A mismatched name (for example creatingnamed.192.168.1.1instead) makes the zone load fail silently. - The
f filetypo. A stray character beforefilein the root-hint stanza is a syntax error. The directive is simplyfile "named.ca";. - Missing trailing dots. An FQDN in a zone file without the final dot becomes relative and silently expands into the wrong name (for example
lpar1.my.example.comturns intolpar1.my.example.com.my.example.com.). - Forgetting to bump the SOA serial. Every time you edit a zone, increase the Serial (the
YYYYMMDDnnconvention is standard). Secondaries and caches ignore changes if the serial did not move. - Using systemd commands. AIX is not Linux. There is no
systemctl; usestartsrc,stopsrc,refresh, andlssrcagainst thenamedsubsystem.
SRC command quick reference
| Action | AIX command |
| Start named | startsrc -s named |
| Stop named | stopsrc -s named |
| Reload zones (no restart) | refresh -s named |
| Check status | lssrc -s named |
| Tail the error log | errpt | grep named / syslog |
Verification: confirm the AIX DNS server is healthy
Do not assume the server works just because startsrc returned without an error. Verify in layers:
- Syntax check before starting. If your AIX BIND level includes the BIND utilities, validate first:
named-checkconf /etc/named.confandnamed-checkzone my.example.com /var/named/named.my.example.com. A clean run printsOK. - Daemon is running.
lssrc -s namedshowsactive, andps -ef | grep namedlists the process. - Port 53 is listening.
netstat -an | grep '\.53 'should show the UDP and TCP listeners. - Forward lookup answers.
dig @localhost lpar2.my.example.com Areturns192.168.1.2in the ANSWER SECTION with statusNOERROR. - Reverse lookup answers.
dig @localhost -x 192.168.1.2returnslpar2.my.example.com. - Resolution through resolv.conf. After updating
/etc/resolv.conf, plainhost lpar3ornslookup lpar3should resolve, proving the system is now using its own server.
If a query returns SERVFAIL or REFUSED, re-run named-checkzone on the relevant file, confirm the filename/SOA serial, and check the system log for the exact parse error. Almost every problem is a typo in a zone file, not a defect in BIND itself.
A note on BIND versions and the modern equivalent
The classic named.conf layout shown here works on long-standing AIX releases and on virtually any BIND deployment. On current systems you would typically run a more recent BIND (BIND 9.x), which adds views, DNSSEC, and stricter defaults. The configuration syntax is compatible, but two habits are worth adopting on modern installs: use a real, regularly updated root-hints file (or forwarders) instead of a hand-written stub, and prefer named-checkconf/named-checkzone for validation. For brand-new infrastructure many teams now reach for unbound (a caching resolver) or managed DNS, but for an authoritative AIX server inside a Power environment, BIND named as configured above remains the standard, supported choice.
Key Takeaways
- BIND
namedis the DNS server on AIX, managed by the SRC withstartsrc/stopsrc/refresh/lssrc— neversystemctl. /etc/named.confdefines the zones; the actual records live in zone files under/var/named, and each file name must exactly match itsfiledirective.- You need both forward (A) and reverse (PTR) zones, plus loopback and root hints, for complete, well-behaved resolution.
- Use straight quotes, real
$TTLvalues, trailing dots on FQDNs, and bump the SOA serial on every edit — these typos cause most failures. - Always verify with
dig @localhostfor both forward and reverse lookups, then point clients at the server via/etc/resolv.conf.
Frequently Asked Questions
How do I start and stop the DNS server on AIX?
AIX manages named through the System Resource Controller. Start it with startsrc -s named, stop it with stopsrc -s named, reload zone changes without a full restart using refresh -s named, and check its state with lssrc -s named. To survive reboots, ensure the named start line in /etc/rc.tcpip is uncommented.
Where are the AIX DNS configuration and zone files located?
The main configuration file is /etc/named.conf. The zone files (forward A records, reverse PTR records, loopback, and root hints) live in the directory named by the directory option in named.conf — conventionally /var/named. Client resolution settings are in /etc/resolv.conf, and the static name database fallback is /etc/hosts.
Why does my AIX DNS server return SERVFAIL or fail to load a zone?
The usual causes are a zone-file typo, a filename that does not match the file directive in named.conf, smart/curly quotes copied from a document, a missing trailing dot on an FQDN, or an unchanged SOA serial after an edit. Run named-checkconf and named-checkzone to pinpoint the exact line, fix it, then refresh -s named.
What is the difference between a forward and a reverse DNS zone?
A forward zone (for example my.example.com) holds A records that map a hostname to an IP address. A reverse zone (for example 1.168.192.in-addr.arpa) holds PTR records that map an IP address back to a hostname. Many services — mail, logging, and security tools — expect both to exist and to agree with each other.
For more hands-on AIX and Unix system administration walkthroughs, subscribe to @explorenystream on YouTube.