First two BIND DNS servers to function correctly.
Primary DNS server ip:192.168.1.100
Client DNS server ip:192.168.1.101
1 Primary DNS-side configuration:
cd/etc/
Generate Rndc.conf File
Rndc-confgen > rndc.conf
View Files
Cat rndc.conf
# Start of Rndc.conf
Key "Rndc-key" {
Algorithm HMAC-MD5;
Secret "vcl5wc2ghczcu7ju+ajc1q==";
};
Options {
Default-key "Rndc-key";
Default-server 127.0.0.1;
Default-port 953;
};
# End of Rndc.conf
# Use with the following in named.conf, adjusting the Allow list as needed:
# key "Rndc-key" {
# algorithm HMAC-MD5;
# secret "vcl5wc2ghczcu7ju+ajc1q==";
# };
#
# controls {
# inet 127.0.0.1 Port 953
# allow {127.0.0.1;} keys {"Rndc-key";};
# };
# End of named.conf
Vim named.conf
Add the following to the end of the named.conf
Support Remote RNDC control
Key "Rndc-key" {
Algorithm HMAC-MD5;
Secret "vcl5wc2ghczcu7ju+ajc1q==";
};
inet: Only allow local use of RNDC control to change * to 127.0.0.1
Allow: Allows this DNS IP, KEY to be managed via RNDC, set as client IP here
Controls {
inet * Port 953
Allow {localhost; 192.168.1.101;} keys {"Rndc-key";};
};
Delete Rndc.key
RM rndc.key-f
Restart bind
Service named restart
2 Client Configuration
cd/etc/
Generate Rndc.conf File
Rndc-confgen > rndc.conf
Edit the file, modify the value in the secret Primary DNS server configuration
Vim rndc.conf
# Start of Rndc.conf
Key "Rndc-key" {
Algorithm HMAC-MD5;
Secret "vcl5wc2ghczcu7ju+ajc1q==";
};
Options {
Default-key "Rndc-key";
Default-server 127.0.0.1;
Default-port 953;
};
# End of Rndc.conf
# Use with the following in named.conf, adjusting the Allow list as needed:
# key "Rndc-key" {
# algorithm HMAC-MD5;
# secret "vcl5wc2ghczcu7ju+ajc1q==";
# };
#
# controls {
# inet 127.0.0.1 Port 953
# allow {127.0.0.1;} keys {"Rndc-key";};
# };
# End of named.conf
Vim named.conf
Add the following to the end of the named.conf note: The value of secret is the same as the secret value in the primary server
Support Remote RNDC control
Key "Rndc-key" {
Algorithm HMAC-MD5;
Secret "vcl5wc2ghczcu7ju+ajc1q==";
};
inet: Only allow local use of RNDC control to change * to 127.0.0.1
Allow: Allows this DNS IP, KEY to be managed through RNDC, which is set as the primary DNS server IP
Controls {
inet * Port 953
Allow {localhost; 192.168.1.100;} keys {"Rndc-key";};
};
Delete Rndc.key
RM rndc.key-f
Restart bind
Service named restart
Bind Configuration RNDC Remote Control