Join to Get Free Linux Server Hacks & cPanel Tips

How to find Bind version using Dig

How to find Bind version using Dig
4.8 (96.67%) 6 votes

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 @ns1.nsname.com

The result will look like:

;; ANSWER SECTION:
version.bind.		0	CH	TXT	"9.8.2rc1-RedHat-9.8.2-0.30.rc1.el6_6.3"

Where “@ns1.nsname.com” 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:

options
{
        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.