Replacing a DNS Server with F5 BIG-IP DNS
First things first, you have decided to deploy F5 BIG-IP DNS to replace a BIND server after receiving notifications from your information assurance officer or your friendly LinkedIn community that additional CVE's have been identified for the version of BIND you are running. In this particular instance you already have a BIG-IP in your DMZ acting as your reverse proxy. You have purchased the best bundle though have only deployed what you know, APM and LTM (common scenario).
After upgrading to version 13 after its release in February 2017 and then determining the latest hotfix using https://support.f5.com/csp/article/K9502, you navigate within the TMUI to System > Resource Provisioning and simply provision DNS.
Once complete you will need to configure your existing BIND server to allow zone transfers to the BIG-IP. In this case, we will define a self-IP on the BIG-IP.
Without the BIG-IP Self IP Defined "allow-transfer { localhost;};"
With the BIG-IP Self IP Defined "allow-transfer { localhost; 10.10.10.2;};"
Once you have allowed the zone transfer, you will create the zone on the BIG-IP and perform the zone transfer.
- On the Main tab, click DNS > Zones > ZoneRunner > Zone List . The Zone List screen opens.
- Click Create.The New Zone screen opens.
- From the View Name list, select the view that you want this zone to be a member of. Note: The default view is external.
- In the Zone Name field, type a name for the zone file in this format, including the trailing dot: db.[viewname].[zonename]. For example, db.external.lyons.demo.com.
- From the Zone Type list, select Master.
- From the Records Creation Method list, select Transfer from Server.
- Within Options, include the following
allow-update { localhost;}; allow-transfer { localhost; }; also-notify { ::1 port 5353; };
- In the Records Creation area, type the values for the SOA and NS record parameters.
- Click Finished
Ok, so you might be asking yourself right about now, "I thought ZoneRunner was a BIND instance?" In this scenario you are correct which is why we are going to slave from on-box BIND to ensure BIND is never accessible externally and we only respond to DNS queries using DNSExpress. Now can you slave from an off-box DNSExpress instance, of course though that is outside the scope of this article.
Prior to creating our DNS profile and listeners, we are going to configure DNS logging. For this use case, we are going to configure logging to the on-box syslog instance.
- In the GUI, navigate to: System > Logs > Configuration > Log Publishers: Create
- Create a new DNS Log Publisher using the defaults unless defined below.
Name: dns-local-syslog
Destinations: Move local-syslog to the Selected column
- In the GUI, navigate to: DNS > Delivery > Profiles > Other > DNS Logging: Create
- Create a new DNS Profile using the defaults unless defined below.
Name: dns-logging
Log Publisher: Select dns-local-syslog
Log Responses: Enabled
Include Query ID: Enabled
Note: For the purposes of this article, we are going to enable all DNS logging options.
Now that we have logging set up to use by our DNS profile, we are going to going ahead and create that object.
- In the GUI, navigate to: DNS > Delivery > Profiles > DNS: Create Create a new DNS profile as shown in the table below. Keep the defaults if not noted in the table.
Name: AuthoritativeNS
Unhandled Query Action: Drop
Use BIND Server on Big-IP: Disabled
Logging: Enabled
Logging Profile: dns-logging
Now that we have created our DNS profile, we are going create our DNS listeners. Remember, F5 is a default deny device so without creating something to listen on all attempts to connect to or query the BIG-IP will be denied.
We are going to create external Listeners that will be our target IP address when querying BIG-IP DNS.
- In the GUI, navigate to: DNS > Delivery > Listeners > Listener List: Create
- Create a two new listeners using the defaults unless defined below.
Name: external-listener-UDP
Destination: Host: 10.1.100.53
VLAN Traffic: Enabled on..
VLANs and Tunnels: external
DNS Profile: AuthoritativeNS
Name: external-listener-TCP
Destination: Host: 10.1.100.53
VLAN Traffic: Enabled on..
VLANs and Tunnels: external
Protocol: TCP
DNS Profile: AuthoritativeNS
So up to this point we have configured your legacy DNS server to perform a DNS transfer with the BIG-IP, created a zone within ZoneRunner, performed the zone transfer from your legacy DNS device, created a DNS profile and listeners on the BIG-IP. Ok, bear with me we are almost done. Our next step is configuring the local device as a name server and then create a DNSExpress zone that you will be performing a zone transfer to using the on-box BIND instance. So let's begin.
- In the GUI, navigate to: DNS > Delivery > Nameservers > Nameserver List: Create
- In this case we will simply provide a Name and leave all other defaults.
Name: BIG-IP1
- Select Finish
In the GUI, navigate to: DNS > Zones > Zones > Zone List: Create
Name: lyons.demo.com
Server: BIG-IP1
Notify Action: Consume
Verify Notify TSIG: Uncheck
Zone Transfer Clients: Move BIG-IP1 from Available to Active
Select Finish
In the GUI, navigate to: DNS > Zones > Zones > Zone List: Create
Name: 198.199.10.in-addr.arpa
Server: BIG-IP1
Notify Action: Consume
Verify Notify TSIG: Uncheck
Zone Transfer Clients: Move BIG-IP1 from Available to Active
Select Finish
Now, our final step...validation. From the cli, simply run a dnsxdump to ensure records have been transferred to DNSExpress as shown below. If you would like to see zone transfers in actions, simply create a resource record within ZoneRunner and run a tail -f on the /var/log/ltm.
You are now complete and have a fully functional authoritative DNS server for your organization without the vulnerabilities of BIND or in an effort to simply consolidate services. If you have any problems at all, please don't ever hesitate to reach out directly. Now my answer may be contact support though I have no problem walking through a scenario or troubleshooting attempt with you.
Reference Documentation
- dragonflymrCirrostratus
Hi Steve,
Great recap, thanks a lot. You mentioned using Bind forwarders - could you explain a bit how those work and when it makes sense to use them. I was always curious about this option when configuring DNS on BIG-IP. Tried to find some good explanation but failed :-(
Piotr
- Steve_LyonsRet. Employee
Hi Piotr. I probably don't have a great answer for you but I will do my best. Also, it seems as though some of the questions/responses have been mixed together with different use cases. With that, I attempt to never use the Bind Forwarders Server List. It provides no high availability or health checking of what you are performing name resolution against. It has and will likely always be a recommended best practice to use pools when configuring the BIG-IP to act as a recursive DNS server. Also, this isn't documented and may be my own experience though I have experienced times when I expect name resolution attempts to continue down the list of BIND Forwarders and DNS servers in the system general settings though it doesn't and name resolution fails on the first attempt. This behavior was not expected from me so therefor I really like the use of DNS pools with DNS health monitors to validate the members are available. I know this probably isn't what you were looking for but I hope it convinces you to use DNS pools! :)
- dragonflymrCirrostratus
Well, not a great answer indeed :-) but thanks a lot for answer!
What I am actually trying to figure out is difference between entering IP in DNS Lookup Server List and BIND Forwarder Server List.
I assume that both are used by BIG-IP to perform queries (like to resolve NTP server FQDN to IP or other FQDNs BIG-IP itself has to resolve) - hope I am right here?
If is main difference between this two config options that second one allows BIG-IP to store responses in local BIND cache? So in compare to first option not every request has to be send to external DNS (if response already exist in local BIND cache)?
Or I totally misunderstand how this options work?
Piotr
- Steve_LyonsRet. Employee
Hahahaha, why didn't you say so! J/K
Sure, the DNS lookup server list specifies the name servers that the system uses to validate DNS lookups, and resolve host names.
The BIND forwarder server list specifies BIND servers that the system can use to perform DNS lookups. BIND allows you to cache and store DNS requests and responses on a local server and minimize DNSserver requests, and bandwidth.
So what this is really saying is that the DNS lookup server list is for system specific name resolution. The BIND forwarder server list is for name resolution for external entities if using the BIG-IP as a name resolution source.
- dragonflymrCirrostratus
Couldn't resist :-))
Wow, so my understanding was totally wrong :-( To be 100% sure if I am getting things right - if for example FQDN nodes are used then DNS servers configured in DNS lookup server list will be used (never from BIND forwarder server list) - right?
Then if we will configure DNS listener without Pool and there are entries in BIND forwarder server list those will be used to resolve request coming to configured DNS resolver - right?
If above is correct I would never, ever figure it out from build-in help description :-(
Piotr
- Steve_LyonsRet. Employee
Hopefully these screenshots help clarify.
First I configured google DNS in the BIND forwarder server list and I am unable to resolve. I then configured it in the DNS lookup server list and can successfully resolve.
Here you can see based on name of the pool I am using different configurations. First pool I have no DNS configured and when attempting to save based on fqdn pool I receive an error to configure DNS. In the 2nd pool I configured google DNS in my BIND forwarder server list and receive an error to configure DNS when trying to save a fqdn pool. Lastly, I configured google dns in my DNS server list and can successfully create an fqdn pool.
Hope this helps clarify! Let me know.
- dragonflymrCirrostratus
Wow, thanks a lot for your time and effort, really appreciate!
From above it's clear that anything configured in BIND Forwarder Server list is not used by BIG-IP for internal name resolution - that is 100% clear now.
Still I am not sure in what situation IPs configured in BIND Forwarder Server list are used. Maybe some small real life example that you can share?
Thanks again,
Piotr
- Misty_SpillersNimbostratus
We really would like F5 to be an all in one DNS solution, unless you have a really good reason why it should not be. We won't have 1000s of people doing recursive DNS but we need to do it. So CAN DNS Express do recursion, with cache to the on box BIND, if yes how? I have followed your steps, but if I disable "use BIND Server on BIG-IP" recursion no longer works.
I have successfully configured DNS Express to respond to authoritative zones using the on box BIND by follow the steps in your original post. I can disable "use BIND Server on BIG-IP" and this works. just not sure about recursion. Thank you so much for all your time on this, it's been a little difficult finding someone to help with architecture, mainly because these are so many options.
- Steve_LyonsRet. Employee
All good Misty. Give me some time to create it again in my own lab and I will shoot you my config.
- Steve_LyonsRet. Employee