{"id":1733,"date":"2026-11-27T11:29:18","date_gmt":"2026-11-27T16:29:18","guid":{"rendered":"https:\/\/blog.miguelsarmiento.com\/?p=1733"},"modified":"2026-11-27T11:34:20","modified_gmt":"2026-11-27T16:34:20","slug":"response-policy-follow-up-use-it-as-a-slave-oh-my","status":"publish","type":"post","link":"https:\/\/blog.miguelsarmiento.com\/?p=1733","title":{"rendered":"Response Policy Follow Up! Use it as a slave. Oh My!"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">In my previous post, I did show how to create a policy respond zone (RPZ) to rewrite DNS records.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">However, if you want to keep using your current DNS server and not have to re-do your zones, make the DNS server that uses RPZ a slave of your main DNS server.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p class=\"wp-block-paragraph\">If you have DNS server on the cloud, make sure that your provider will allow zone transfers from your IP.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you host your own then just make sure you do not have a firewall rule preventing access locally.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you need to add a server, go ahead and create a standard BIND server (or whatever DNS server you may want to use), I will be using BIND for the slave, it is up to you.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">One note, you could use DNSMASQ as your primary, it is a fantastic tool. However it is useful for small shops, I mean 20 or less, if you have more than that you are better off using BIND.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Installing a master bind server is similar to what I described previously, it is fairly straight forward.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Before installing the slave one, make sure that the primary resolves and have records for the machines you need.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now we need to make a few changes to the configuration we did.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On the bind folder rename both db.test.com and db.192.168.1, we will not need them since we will be transferring records form the master.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"> Edit &#8220;named.conf.options&#8221; and make sure that forwarders point to your master server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Edit &#8220;named.conf.local&#8221; and change the following:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">zone \"test.com\" {<br>\/\/ Below makes it a slave zone<br>    <strong>type slave;<\/strong><br>\/\/ IP of the master<br>    primaries { 10.20.1.53; };<br>\/\/    file \"\/etc\/bind\/db.test.com\";<br>    file \"\/var\/cache\/bind\/db.test.com\";<br>    allow-query { any; };<br>};<br><br>zone \"192.168.1.in-addr.arpa\" {<br>\/\/ Below makes it a slave zone<br>    <strong>type slave;<\/strong><br>\/\/ IP of the master<br>    primaries { 10.20.1.53; };<br>\/\/    file \"\/etc\/bind\/db.192.168.1\";<br>    file \"\/var\/cache\/bind\/db.192.168.1\";<br>    allow-query { any; };<br>};<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">We are using &#8220;\/var\/cache\/bind&#8221; to store the transfers. Keep your entry for the RPZ zone. Make sure it remains a &#8220;master&#8221; zone.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now, restart bind. If there are no errors, you should have a couple temp files in that folder.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If they are empty, check the logs and find out if the master if refusing connections, fix the issue.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If everything is ok, on the client just issue a few digs commands.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Use dig and resolve for google.com, then for a machine that should be in you network, in our case machine.test.com for example (remember you should have an A record already on the master).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Finally do a dig for one of the machines you want to re-write a record. It should work.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"> There you have it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Ciao. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>In my previous post, I did show how to create a policy respond zone (RPZ) to rewrite DNS records. However, if you want to keep using your current DNS server and not have to re-do your zones, make the DNS server that uses RPZ a slave of your main DNS server.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17,14],"tags":[],"class_list":["post-1733","post","type-post","status-publish","format-standard","hentry","category-bind","category-linux"],"_links":{"self":[{"href":"https:\/\/blog.miguelsarmiento.com\/index.php?rest_route=\/wp\/v2\/posts\/1733","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.miguelsarmiento.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.miguelsarmiento.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.miguelsarmiento.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.miguelsarmiento.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1733"}],"version-history":[{"count":15,"href":"https:\/\/blog.miguelsarmiento.com\/index.php?rest_route=\/wp\/v2\/posts\/1733\/revisions"}],"predecessor-version":[{"id":1749,"href":"https:\/\/blog.miguelsarmiento.com\/index.php?rest_route=\/wp\/v2\/posts\/1733\/revisions\/1749"}],"wp:attachment":[{"href":"https:\/\/blog.miguelsarmiento.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1733"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.miguelsarmiento.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1733"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.miguelsarmiento.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1733"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}