I've recently made a PoC at work where I build a scalable DNS Infrastructure. Please note that while the schematic includes the Windows Network, I will not go into detail with that one since this is out of scope.
Linux Datacenter (internal zones only):
FreeIPA / Red Hat IDM is a full identity management solution by Red Hat which integrates the following components:
Authoritative DNS (external zones only):
Knot-DNS is a high-performance authoritative DNS Server. That means, it just covers the zones itself knows about and is authoritative for. It will not forward DNS Queries to its upstream hosts.
Now, let's jump into what needs to be done to make this setup reality. I'll start by setting up the Knot-Servers.
Start by setting up the master, first install the knot server and utils:
Linux Datacenter (internal zones only):
FreeIPA / Red Hat IDM is a full identity management solution by Red Hat which integrates the following components:
- - 389-DS
- - Krb5kdc
- - Bind Nameserver
- - Dogtag CA
- - Certmonger
Authoritative DNS (external zones only):
Knot-DNS is a high-performance authoritative DNS Server. That means, it just covers the zones itself knows about and is authoritative for. It will not forward DNS Queries to its upstream hosts.
Now, let's jump into what needs to be done to make this setup reality. I'll start by setting up the Knot-Servers.
Start by setting up the master, first install the knot server and utils:
[archy@ns01 ~]$ yum -y install knot knot-utils
The config by default is pretty good documented. I'll configure a very basic setup, so there's not much to do. Edit the config with your favorite editor, in my case the config you see is what I found working for me. [archy@ns01 ~]$ vim /etc/knot/knot.conf
# the server configuration with the user the service is running as and the address the server listens to.
server:
rundir: "/run/knot"
user: knot:knot
listen: [ 0.0.0.0@53 ]
# where to log, syslog is usually a good start
log:
- target: syslog
any: info
# this is the section where to define your slaves / remote masters
remote:
- id: slave
address: 172.31.0.2@53
# ACLs allow which host is allowed to do what
acl:
- id: acl_slave
address: 172.31.0.2
action: transfer
- id: access_rule
address: [172.31.0.0/24, 172.31.100.0/24]
action: transfer
- id: deny_rule
address: [0.0.0.0/0]
action: transfer
deny: on
# Will leave essentially default for now
template:
- id: default
storage: "/var/lib/knot/zones"
file: "%s.zone"
# the first zone definition. All these parameters should be self explanatory.
zone:
# Master zone
- domain: archyslife.lan
storage: /var/lib/knot/zones/
file: archyslife.lan.zone
acl: [acl_slave, access_rule, deny_rule]
notify: slave
With the config adjusted, create the directory for the zones and define your master zone. For more info on this, check out my bind master-slave article. [archy@ns01 ~]$ mkdir /var/lib/knot/zones
[archy@ns01 ~]$ vim /var/lib/knot/zones/archyslife.lan.zone
@ IN SOA ns01.archyslife.lan. ns02.archyslife.lan. (
2018062615 ; Serial
3600 ; Refresh (1 Hour)
3600 ; Retry (1 Hour)
604800 ; Expire (1 Week)
3600 ; Minimum (1 Hour)
)
@ NS ns01.archyslife.lan.
@ NS ns01.archyslife.lan.
; A Records
@ A 172.31.0.1
@ A 172.31.0.2
ns01 A 172.31.0.1
ns02 A 172.31.0.2
...
Make the knot service persistent accross reboots and start it: [archy@ns01 ~]$ sudo systemctl enable knot.service
[archy@ns01 ~]$ sudo systemctl start knot.service
With the master set up, continue with the slave setup, again by starting to install the necessary components: [archy@ns02 ~]$ yum -y install knot knot-utils
Next, edit the config to your liking. I ended up with this: [archy@ns02 ~]$ vim /etc/knot/knot.conf
# the server configuration with the user the service is running as and the address the server listens to.
server:
rundir: "/run/knot"
user: knot:knot
listen: [ 0.0.0.0@53 ]
# where to log, syslog is usually a good start
log:
- target: syslog
any: info
# this is the section where to define your slaves / remote masters
remote:
- id: master
address: 172.31.0.178@53
# ACLs allow which host is allowed to do what
acl:
- id: acl_master
address: 172.31.0.178
action: notify
- id: access_rule
address: [172.31.0.0/24, 172.31.100.0/24]
action: transfer
- id: deny_rule
address: [0.0.0.0/0]
action: transfer
deny: on
# Will leave essentially default for now
template:
- id: default
storage: "/var/lib/knot"
file: "%s.zone"
# the first zone definition. All these parameters should be self explanatory.
zone:
# Slave zone
- domain: archyslife.lan
storage: /var/lib/knot/zones
file: archyslife.lan.zone
acl: [acl_master, access_rule, deny_rule]
master: master
With the slave's config all done, create the directory for the zones and copy-paste it from your master. This is just to have this backed up on a separate host. [archy@ns02 ~]$ mkdir /var/lib/knot/zones
[archy@ns02 ~]$ vim /var/lib/knot/zones/archyslife.lan.zone
@ IN SOA ns01.archyslife.lan. ns02.archyslife.lan. (
2018062615 ; Serial
3600 ; Refresh (1 Hour)
3600 ; Retry (1 Hour)
604800 ; Expire (1 Week)
3600 ; Minimum (1 Hour)
)
@ NS ns01.archyslife.lan.
@ NS ns01.archyslife.lan.
; A Records
@ A 172.31.0.1
@ A 172.31.0.2
ns01 A 172.31.0.1
ns02 A 172.31.0.2
...
Enable and restart the services to check everything comes up as expected and make the service start at reboot. [archy@ns02 ~]$ sudo systemctl enable knot.service
[archy@ns02 ~]$ sudo systemctl start knot.service
With the Authoritative DNS Section up and running, it's time to make the FreeIPA Hosts forward to the specified DNS Servers [archy@ipa01 ~]$ kinit
Password for archy@ARCHYSLIFE.LAN:
[archy@ipa01 ~]$ ipa dnsforwardzone-add archyslife.lan --forwarder=172.31.0.1 --forwarder=172.31.0.2 --forward-policy=only
Check back on the changes you've done and verify these are correct:
[archy@ipa01 ~]$pa dnsforwardzone-find
Zone name: archyslife.lan.
Active zone: TRUE
Zone forwarders: 172.31.0.1, 172.31.0.2
Forward policy: only
----------------------------
Number of entries returned 1
----------------------------
Check your forwarding by running a query to your IPA Server for your Knot-DNS hosted zone:
Note: 172.31.100.250 is the address of my IPA Server
[archy@client ~]$ nslookup ns01.archyslife.lan 172.31.100.250
Server: 172.31.100.250
Address: 172.31.100.250#53
Non-authoritative answer:
Name: ns01.archyslife.lan
Address: 172.31.0.1
Everything looks good so far. If you have any troubles configuring and feel the urge to extend the config, check the manual for Knot-DNS.
Feel free to comment and / or suggest a topic.
Comments
Post a Comment