≡ Menu

How to change the port on which Bind listens to?

Bind has a configuration file which can be edited to change the port on which Bind listens to:


In this file, you can change the port by adding the following statement to the global options directive:

port 54

Adding the above statement will make Bind listen on port 54 instead of the default port 53.

So the global options looks like the following:

options {
directory                "/var/named"; // the default
pid-file                 "/var/run/named/named.pid";
dump-file                "data/cache_dump.db";
statistics-file          "data/named_stats.txt";
allow-transfer {"none";};
allow-recursion {"none";};
recursion no;
port 54;

Note that changing the port on which Bind listens to, to any port other than 53 will cause DNS to stop working for your domain names! Change the port only to test or debug your server installation and then change the port back to 53 by deleting all port directives from your /etc/named.conf file.

Comments on this entry are closed.