Configuring DNS (BIND) and DHCP (Kea) on RHEL 10
Set up DNS with BIND and DHCP with Kea on RHEL 10: named.conf, forward and reverse zones, kea-dhcp4.conf, firewall rules and dig tests.
On RHEL 10, DNS is served by BIND (the bind package, named service) and DHCP by Kea (the kea package, kea-dhcp4 and kea-dhcp6 services). The old ISC DHCP server, dhcpd, is no longer included in RHEL 10. Kea uses JSON configuration files in /etc/kea/, so dhcpd.conf files do not carry over.
This guide builds a small lab: one RHEL 10 server that answers DNS for example.com and hands out addresses on 192.0.2.0/24. Every command and file was checked against the RHEL 10 documentation on docs.redhat.com in November 2026. The server needs a static IP address first; if you have not set one, follow our guide to configuring networking in RHEL 10. For the wider setup sequence, start with our RHEL 10 first-time setup guide.
Key takeaways
- Install DNS with
dnf install bind bind-utils. The main file is/etc/named.conf, and zone files live in/var/named/. - Check your work with
named-checkconfandnamed-checkzonebefore every reload. - Red Hat removed the
dhcppackages (dhcp-server, dhcp-client, dhcp-relay) in RHEL 10 and points users to Kea. - Kea DHCPv4 reads
/etc/kea/kea-dhcp4.conf. Test it withkea-dhcp4 -tand run it withsystemctl enable --now kea-dhcp4. - Open the firewall with the firewalld services
dns,dhcpand, for IPv6,dhcpv6. - Test DNS with
dig @localhostand DHCP by switching a client profile toipv4.method auto.
DNS and DHCP services on RHEL 10 at a glance
| Service | Package | systemd unit | Config file | firewalld service |
|---|---|---|---|---|
| DNS (BIND) | bind, bind-utils | named (or named-chroot) | /etc/named.conf, /var/named/*.zone | dns |
| DHCPv4 (Kea) | kea | kea-dhcp4 | /etc/kea/kea-dhcp4.conf | dhcp |
| DHCPv6 (Kea) | kea | kea-dhcp6 | /etc/kea/kea-dhcp6.conf | dhcpv6 |
Lab plan used in this guide
| Item | Value |
|---|---|
| Server name and IP | ns1.example.com, 192.0.2.1/24 (static) |
| Default gateway for clients | 192.0.2.254 |
| Web server record | www.example.com, 192.0.2.30 |
| Mail server record | mail.example.com, 192.0.2.20 |
| DHCP pool | 192.0.2.100 to 192.0.2.200 |
| Server interface | enp1s0 |
192.0.2.0/24 and example.com are reserved documentation values. Replace them with your own network and domain.
Part 1: Configure a BIND DNS server
Step 1: Install BIND
dnf install bind bind-utils
If dnf cannot find the packages, your repositories are not set up yet. See how to configure RHEL 10 repositories after installation.
Red Hat recommends running the normal named service with SELinux in enforcing mode, which is the default, over the chroot variant. If you need a change-root setup, install bind-chroot and use the named-chroot service in place of named in every command below. Our SELinux guide for RHEL 10 explains enforcing mode.
Step 2: Set the listening addresses and who may query
Edit the options block in /etc/named.conf:
options {
listen-on port 53 { 127.0.0.1; 192.0.2.1; };
listen-on-v6 port 53 { ::1; };
directory "/var/named";
allow-query { localhost; 192.0.2.0/24; };
allow-recursion { localhost; 192.0.2.0/24; };
// optional: forward external lookups to upstream resolvers
// forwarders { 198.51.100.1; 203.0.113.5; };
...
};
Keep the other lines that ship in the default file. Limit allow-recursion to your own networks. Red Hat warns that allowing recursion on a public address can make the server part of DNS amplification attacks. With forwarders set, BIND still falls back to normal recursion if the forwarders do not answer, unless you also add forward only;.
Step 3: Add the forward and reverse zone definitions
Append these zone blocks to /etc/named.conf:
zone "example.com" {
type master;
file "example.com.zone";
allow-query { any; };
allow-transfer { none; };
};
zone "2.0.192.in-addr.arpa" {
type master;
file "2.0.192.in-addr.arpa.zone";
allow-query { any; };
allow-transfer { none; };
};
The file paths are relative to the directory option, so they resolve to /var/named/. A reverse zone for a /24 network is named with the first three octets reversed, followed by in-addr.arpa. Keep allow-transfer { none; } until you add a secondary server, then list only that server's IP.
named-checkconf
No output means the syntax is correct.
Step 4: Create the forward zone file
Create /var/named/example.com.zone:
$TTL 8h
@ IN SOA ns1.example.com. hostmaster.example.com. (
2026110701 ; serial number
1d ; refresh period
3h ; retry period
3d ; expire time
3h ) ; minimum TTL
IN NS ns1.example.com.
IN MX 10 mail.example.com.
ns1 IN A 192.0.2.1
www IN A 192.0.2.30
mail IN A 192.0.2.20
Note the trailing dot after every fully qualified name. Without it, BIND appends the zone name, so ns1.example.com would become ns1.example.com.example.com.. The hostmaster.example.com. field is the contact email with the @ replaced by a dot. A serial in the form year, month, day plus a two-digit counter is a common convention.
Step 5: Create the reverse zone file
Create /var/named/2.0.192.in-addr.arpa.zone:
$TTL 8h
@ IN SOA ns1.example.com. hostmaster.example.com. (
2026110701 ; serial number
1d ; refresh period
3h ; retry period
3d ; expire time
3h ) ; minimum TTL
IN NS ns1.example.com.
1 IN PTR ns1.example.com.
20 IN PTR mail.example.com.
30 IN PTR www.example.com.
Step 6: Set permissions and check the zones
chown root:named /var/named/example.com.zone /var/named/2.0.192.in-addr.arpa.zone
chmod 640 /var/named/example.com.zone /var/named/2.0.192.in-addr.arpa.zone
named-checkzone example.com /var/named/example.com.zone
named-checkzone 2.0.192.in-addr.arpa /var/named/2.0.192.in-addr.arpa.zone
Each check should end with OK after a line such as zone example.com/IN: loaded serial 2026110701.
Step 7: Open the firewall and start named
firewall-cmd --permanent --add-service=dns
firewall-cmd --reload
systemctl enable --now named
After later edits, use systemctl reload named. More firewall examples are in our RHEL 10 firewalld commands post.
Step 8: Test with dig
dig +short @localhost A www.example.com
dig +short @localhost NS example.com
dig +short @localhost MX example.com
dig +short @localhost -x 192.0.2.30
dig @localhost www.redhat.com
Expected answers: 192.0.2.30, ns1.example.com., 10 mail.example.com. and www.example.com.. The last query tests recursion. Run it twice; the second answer comes from the cache and the "Query time" drops sharply. From another host on the subnet, replace @localhost with @192.0.2.1.
Updating a zone later
Edit the zone file, raise the serial number, run named-checkzone, then systemctl reload named. Secondary servers only pull a new copy when the serial is higher than the one they hold, so a forgotten serial bump is the most common reason a change does not spread.
Part 2: Configure a Kea DHCP server
Step 1: Install Kea
dnf install kea
Kea runs DHCPv4 and DHCPv6 as separate services with separate files. This guide sets up DHCPv4 and notes the IPv6 differences at the end.
Step 2: Write /etc/kea/kea-dhcp4.conf
Back up the shipped file, then replace its contents with a configuration like this:
{
"Dhcp4": {
"valid-lifetime": 86400,
"option-data": [
{ "name": "domain-name", "data": "example.com" },
{ "name": "domain-name-servers", "data": "192.0.2.1" }
],
"interfaces-config": {
"interfaces": [ "enp1s0" ]
},
"subnet4": [
{
"id": 1,
"subnet": "192.0.2.0/24",
"pools": [
{ "pool": "192.0.2.100 - 192.0.2.200" }
],
"option-data": [
{ "name": "routers", "data": "192.0.2.254" }
]
}
]
}
}
What each part does:
valid-lifetime: lease time in seconds (86400 is one day).option-dataat the top level: options sent to every subnet. Here clients get the BIND server from Part 1 as their resolver andexample.comas their domain.interfaces-config: the interfaces Kea listens on.subnet4: each subnet needs a uniqueid, the network in CIDR form, one or morepools, and its own options such asrouters. Subnet options override global ones.
Kea accepts // comments in its configuration files, as the Red Hat examples show. For subnets behind a DHCP relay, add the remote subnet with a "relay": { "ip-addresses": [ ... ] } block that lists the trusted relay agents.
Step 3: Check the syntax
kea-dhcp4 -t /etc/kea/kea-dhcp4.conf
If the output contains "Syntax check failed", fix the reported line before you continue. A missing comma between JSON objects is the usual cause.
Step 4: Open the firewall and start the service
firewall-cmd --permanent --add-service=dhcp
firewall-cmd --reload
systemctl enable --now kea-dhcp4
ss -lunp | grep -E ':(67|547)'
The last command should show Kea listening on UDP port 67. If it is missing for an interface, check interfaces-config. For service and log checks, our guide on managing services and processes in RHEL 10 covers systemctl status and journalctl.
Step 5: Reserve a fixed address for one host
Add a reservations list inside the subnet to always give one MAC address the same IP. Pick an address outside the dynamic pool so it cannot already be leased to another client:
"subnet4": [
{
"id": 1,
"subnet": "192.0.2.0/24",
"pools": [ { "pool": "192.0.2.100 - 192.0.2.200" } ],
"reservations": [
{ "hw-address": "52:54:00:72:2f:6e", "ip-address": "192.0.2.50" }
],
"option-data": [ { "name": "routers", "data": "192.0.2.254" } ]
}
]
kea-dhcp4 -t /etc/kea/kea-dhcp4.conf
systemctl restart kea-dhcp4
The kea-doc package installs more examples under /usr/share/doc/kea/examples/.
Step 6: Test from a client
On a RHEL client in the same network, switch its profile to DHCP and check the address it receives:
nmcli connection modify "Wired connection 1" ipv4.method auto
nmcli connection up "Wired connection 1"
ip address show
cat /etc/resolv.conf
The client should get an address from the pool (or its reservation) and list nameserver 192.0.2.1 and search example.com. On the server, Kea's default memfile backend records leases in /var/lib/kea/kea-leases4.csv. Read that file but do not edit it; Kea keeps leases in memory and can overwrite manual changes.
DHCPv6 differences
For IPv6, use /etc/kea/kea-dhcp6.conf with a top-level "Dhcp6" key, subnet6 in place of subnet4, and the dns-servers option in place of domain-name-servers. Check it with kea-dhcp6 -t /etc/kea/kea-dhcp6.conf, open the dhcpv6 firewalld service and run systemctl enable --now kea-dhcp6. Kea DHCPv6 listens on UDP port 547.
Moving from ISC dhcpd to Kea
If you have a dhcpd.conf from RHEL 9 or earlier, the concepts map across, but you rewrite the file in JSON.
| ISC dhcpd (RHEL 9 and earlier) | Kea (RHEL 10) |
|---|---|
/etc/dhcp/dhcpd.conf | /etc/kea/kea-dhcp4.conf |
systemctl enable dhcpd | systemctl enable kea-dhcp4 |
subnet ... netmask ... { range ...; } | subnet4 entry with subnet and pools |
option routers, option domain-name-servers | option-data entries named routers, domain-name-servers |
host { hardware ethernet ...; fixed-address ...; } | reservations with hw-address and ip-address |
default-lease-time | valid-lifetime |
/var/lib/dhcpd/dhcpd.leases | /var/lib/kea/kea-leases4.csv |
dhcpd -t | kea-dhcp4 -t <file> |
Troubleshooting
| Symptom | Likely cause | Check |
|---|---|---|
| named fails to start | Syntax error in named.conf or a zone | named-checkconf, named-checkzone, journalctl -u named |
| Lookups work on the server but not from clients | listen-on, allow-query or firewall | firewall-cmd --list-services; add the server IP to listen-on |
| Names resolve to name.example.com.example.com | Missing trailing dot in the zone file | Add the dot after each FQDN |
| Zone change not visible | Serial not raised or service not reloaded | Increase the serial, systemctl reload named |
| "dhcp-server" package not found | ISC DHCP removed in RHEL 10 | Install kea |
| kea-dhcp4 exits at start | Invalid JSON | kea-dhcp4 -t /etc/kea/kea-dhcp4.conf |
| Clients get no address | Wrong interface, firewall, or no pool for that subnet | ss -lunp | grep :67, firewall-cmd --list-services |
Build these skills in a lab
Name resolution and network services show up throughout Linux administration work and in RHCE-level automation. Our RHCSA training starts with networking, firewalld and SELinux on RHEL, and our Linux administration course goes further into server services. Both run in the classroom in Kharadi, Pune and live online.
Frequently asked questions
Is dhcpd available in RHEL 10?
No. Red Hat removed the ISC DHCP packages, including dhcp-server, from RHEL 10. The supported DHCP server is Kea, installed with dnf install kea and run as kea-dhcp4 and kea-dhcp6.
Which DNS server does RHEL 10 use?
RHEL 10 ships BIND 9.18 in the bind package, run as the named service. Red Hat also documents Unbound for caching-only setups and dnsconfd for local DNS cache configuration.
Which ports do DNS and DHCP need?
DNS uses port 53 over UDP and TCP. DHCPv4 servers listen on UDP 67 and DHCPv6 servers on UDP 547. On RHEL 10, open them with the firewalld services dns, dhcp and dhcpv6.
Can I reuse my dhcpd.conf with Kea?
Not directly. Kea uses JSON, so you rewrite the settings: subnets become subnet4 entries, ranges become pools, options go into option-data, and host entries become reservations.
How do I test a BIND zone before reloading?
Run named-checkconf for /etc/named.conf and named-checkzone <zone> <file> for each zone file. Both must pass before you run systemctl reload named.
Where does Kea store DHCP leases?
With the default memfile backend, DHCPv4 leases go to /var/lib/kea/kea-leases4.csv and DHCPv6 leases to /var/lib/kea/kea-leases6.csv. Kea can also use MySQL or PostgreSQL. Do not edit the CSV files by hand.
Should I run BIND in a chroot on RHEL 10?
Red Hat states that running named with SELinux in enforcing mode is more secure than the chroot setup. Use named-chroot only if your policy requires it.
References
- Red Hat: Managing networking infrastructure services (RHEL 10): BIND, Unbound and Kea
- Red Hat: Considerations in adopting RHEL 10, Infrastructure services
- Red Hat: RHEL 10.0 release notes
- Red Hat: Configuring firewalls and packet filters (RHEL 10)
- ISC: Kea Administrator Reference Manual
- RFC 1912: Common DNS operational and configuration errors
What's Your Reaction?
Like
0
Dislike
0
Love
0
Funny
0
Angry
0
Sad
1
Wow
0