How to find Bind version using Dig

By default BIND DNS server always reveals the version number. While this is not a security hole by itself, it’s the first point that a potential attacker will try to find out, the version number of your software and from that point he will try to find exploits for that version. That’s why today you will learn two important things: how to find bind version, and also how to protect against the same by hidding the version from any DNS queries.

How to check / find Bind version using Dig command

To know if you are vulnerable you can use a simple dig command against certain TXT records. For example:

dig chaos txt version.bind

The result will look like:

version.bind.		0	CH	TXT	"9.8.2rc1-RedHat-9.8.2-0.30.rc1.el6_6.3"

Where “” is the real name server that you are targeting.

How can I hide the BIND version?

Simple: edit your named.conf file (usally located at /etc/named.conf), and then add the ‘version’ directive under the options section. This will block the version.bind query against your name servers, example:

version "BIND";

This is how your code should look after the changes:

        query-source    port 53;
        version "BIND";

Once you are done, restart bind to apply the changes:

service named restart

At this point you should know how to find bind version, and also how to hide it. If you need to read more about BIND, you can visit this Bind.

About the Author: Esteban Borges

Experienced Sr. Linux SysAdmin and Web Technologist, passionate about building tools, automating processes, fixing server issues, troubleshooting, securing and optimizing high traffic websites.

Leave a Reply

Your email address will not be published. Required fields are marked *