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
- Steve_LyonsRet. Employee
Misty, see the screenshots above. This is a functional recursive configuration. It really takes very little.
- Misty_SpillersNimbostratus
I'm missing something. What's in "DNSPool" I'm not sure how to reference the "on box BIND." Local address in named.conf 127.0.0.1?
Thank you again!
- Steve_LyonsRet. Employee
Ahhhh, I see. Forget about BIND altogether for recursion (my recommendation of course). Create an LTM pool with the servers your BIG-IP should be using for resolution. Attach that pool to your listener and boom. You are really just a reverse proxy for DNS lookups. I may have created older documentation which shows the BIND configuration options but again, disregard and disable BIND. Use a pool of DNS servers. Let me know.
- Steve_LyonsRet. Employee
Also, updated the comment above with screenshots to include one with the servers I have in my DNS Pool. For demo purposes I am using google and quad 9 though your organization may have other external servers to perform queries against.
- Misty_SpillersNimbostratus
I have always understood that setup, but our DNS servers are very old and we were hoping F5 could handle everything and, of course, we were told that it could, you know how it goes :) So essentially we are building this from scratch and I'm hearing I need acquire additional actual DNS servers for a "recommended setup with recursion"
As for on box BIND recursion seems to work fine but it's not under any load at all. I wonder what the limitations are? We are not google, only a very small set of customers would be allowed to do recursion.
- Steve_LyonsRet. Employee
So, yes these boxes can be an all in one DNS solution with nothing more. You don't need to buy anything else. It's all about your use case. So, my typical use case is completely different from yours as my customers MUST point to a specific server for actual resolution. AD Integrated DNS > F5 Recursive DNS > Required Recursive > Internet. Now that I think it's defined, you want recursion and the BIG-IP to do all name resolution for you, the BIG-IP will use root hints to do the lookup. Give me a sec and I will send you what that looks like.
- Steve_LyonsRet. Employee
Create a resolver cache.
Code
Assign the resolver cache to the DNS profile and assign the profile to your DNS listener. The cache resolver will use root hints.
- Misty_SpillersNimbostratus
Wow, I think after all this time (I been working on this with other F5 folks) I think this is what I was looking for. Just like your profile "use BIND Server on BIG-IP" is now disable, recursion is working. As per your original profile I also set the "Unhandled Query Actions" to "drop" This also seems to work.
Thank you so much
- Steve_LyonsRet. Employee
No problem! Glad this is working for you.
Nice work Steve answering these requests.
Couple extra pieces of information that may support the question:
Recursive Resolver Lab Material: https://clouddocs.f5.com/training/community/dns/html/class2/module5/module5.html
There is also a great F5 DNS INE course which covers various Design and Architectures for F5 DNS in Section 1: https://streaming.ine.com/c/exam-302-big-ip-dns-specialist