Configure BIND DNS Server to Listen Only On Certain IP Address or Network Interface

Configure BIND DNS Server to Listen Only On Certain IP Address or Network Interface

To configure the BIND DNS server to listen only on certain IP addresses or network interfaces, you will need to modify the listen-on directive in the named.conf configuration file.

For example, to configure BIND to listen only on the loopback interface (127.0.0.1) and the IP address 192.0.2.1, you can add the following directive to the named.conf file:

‮refer‬ to:lautturi.com
listen-on { 127.0.0.1; 192.0.2.1; };

You can also specify the network interface by name, using the interface keyword. For example:

listen-on { interface lo; 192.0.2.1; };

This will configure BIND to listen on the loopback interface (lo) and the IP address 192.0.2.1.

By default, BIND listens on all available interfaces. You can use the listen-on directive to restrict BIND to listen only on specific interfaces or IP addresses.

After modifying the named.conf file, you will need to restart the BIND server for the changes to take effect.

service bind9 restart

Keep in mind that the listen-on directive only controls which interfaces and IP addresses BIND listens on for incoming DNS queries. It does not control which interfaces and IP addresses BIND uses to send outbound queries. To control outbound queries, you will need to use the query-source directive.

Created Time:2017-10-28 14:02:23  Author:lautturi