DNS controls 语句
2016-02-23 17:56
127 查看
文章转自:http://blog.sina.com.cn/s/blog_6c2e6f1f0100l982.html
controls语句规定了rndc如何控制一个正在与行的named进程。rndc可以启动和停止named,转储其状态,将其转入调试模式等。
rndc是一个网络程序,如果配置不正确非常危险。
语法是:
controls {
inet ip_addr port ip-port allow { address_match_list } keys {
key_list };
如果没有定义port子句指定端口,那么rndc使用默认端口953
例子:
[root@test1
test]# cat
/etc/named.conf
options {
version "i donot know";
directory "/var/named";
recursion
no;
dump-file
"/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
};
key "rndckey"
{
algorithm hmac-md5;
secret
"Wpsjg97qGN/y5R3dLq1wb+fWqupxFaIllL0E159Z0DQ=";
};
controls {
inet 127.0.0.1 port 953
allow { 127.0.0.1; } keys { "rndckey"; };
zone "." {
type hint;
file "named.ca";
};
.....
例中的key由rndc-confgen命令输出:
[root@test1 test]#
rndc-confgen
# Start of rndc.conf
key "rndckey" {
algorithm hmac-md5;
secret "Wpsjg97qGN/y5R3dLq1wb+fWqupxFaIllL0E159Z0DQ=";
};
options {
default-key "rndckey";
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 "rndckey" {
#
algorithm hmac-md5;
#
secret "Wpsjg97qGN/y5R3dLq1wb+fWqupxFaIllL0E159Z0DQ=";
# };
#
# controls {
#
inet 127.0.0.1 port 953
#
allow { 127.0.0.1; } keys { "rndckey"; };
# };
# End of named.conf
其中被#注释掉的就是加到named.conf中的行,他们能让named和rndc一起工作。
或者运行rndc-confgen -a -b
256就会生成文件 /etc/rndc.key,其中包括:
key "rndckey" {
algorithm hmac-md5;
secret "Wpsjg97qGN/y5R3dLq1wb+fWqupxFaIllL0E159Z0DQ=";
};
这个文件模式为600,属主为named或者root,然后使用include语句把它加到named.conf中,例如:
[root@test1
test]# more
/etc/named.conf
options {
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
};
include "/etc/rndc.key";
controls语句规定了rndc如何控制一个正在与行的named进程。rndc可以启动和停止named,转储其状态,将其转入调试模式等。
rndc是一个网络程序,如果配置不正确非常危险。
语法是:
controls {
inet ip_addr port ip-port allow { address_match_list } keys {
key_list };
如果没有定义port子句指定端口,那么rndc使用默认端口953
例子:
[root@test1
test]# cat
/etc/named.conf
options {
version "i donot know";
directory "/var/named";
recursion
no;
dump-file
"/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
};
key "rndckey"
{
algorithm hmac-md5;
secret
"Wpsjg97qGN/y5R3dLq1wb+fWqupxFaIllL0E159Z0DQ=";
};
controls {
inet 127.0.0.1 port 953
allow { 127.0.0.1; } keys { "rndckey"; };
zone "." {
type hint;
file "named.ca";
};
.....
例中的key由rndc-confgen命令输出:
[root@test1 test]#
rndc-confgen
# Start of rndc.conf
key "rndckey" {
algorithm hmac-md5;
secret "Wpsjg97qGN/y5R3dLq1wb+fWqupxFaIllL0E159Z0DQ=";
};
options {
default-key "rndckey";
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 "rndckey" {
#
algorithm hmac-md5;
#
secret "Wpsjg97qGN/y5R3dLq1wb+fWqupxFaIllL0E159Z0DQ=";
# };
#
# controls {
#
inet 127.0.0.1 port 953
#
allow { 127.0.0.1; } keys { "rndckey"; };
# };
# End of named.conf
其中被#注释掉的就是加到named.conf中的行,他们能让named和rndc一起工作。
或者运行rndc-confgen -a -b
256就会生成文件 /etc/rndc.key,其中包括:
key "rndckey" {
algorithm hmac-md5;
secret "Wpsjg97qGN/y5R3dLq1wb+fWqupxFaIllL0E159Z0DQ=";
};
这个文件模式为600,属主为named或者root,然后使用include语句把它加到named.conf中,例如:
[root@test1
test]# more
/etc/named.conf
options {
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
};
include "/etc/rndc.key";
相关文章推荐
- 有趣百姓网,介绍一个人注册并发布…
- 为不同的虚拟主机设定不同的字符编…
- 淘客心得 PV是王道(原创)
- Linux netstat -tl 显示当前监听的…
- nmap 使用方法 及作用
- Linux 如何关闭及启用一个端口
- LINUX 设置开机时启动服务的方法
- 新浪博客等级及积分计算
- 新浪博客文字不换行怎么办?
- 今天才发现新浪博客里还有博客电台
- 由3.15央视曝光健美猪想到的
- 2016,在路上
- 适配器模式
- 暴力破解目录和文件位置
- 前端开发工具
- Unity教程之-制作闪亮的星星Star(二):创建Shader
- Apache Kylin 大数据时代的OLAP利器
- linux下查看CPU.内存型号.pci 转自…
- cnzz 数据专家,免费网张流量统计
- 转载:Linux全攻略--DNS服务器配置…