绑定和打开端口

我最近在CentOS上安装了Bind。 一切似乎只有端口53打开工作。 不过,我注意到在configuration文件中,rndc.conf中有一行表示“default-port 953;” 我没有端口953打开,绑定似乎正在工作。 我可以保持953closures吗? RNDC在953上聆听的重点是什么?

这是什么打印?

$ sudo netstat -ntlp | grep ':953\>' 

它应该打印像这样的东西:

 tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN 1234/named 

或者如果你启用了IPv6的话:

 tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN 1234/named tcp 0 0 ::1:953 :::* LISTEN 1234/named 

由于它仅使用回送地址,因此只能由login到服务器本身的用户访问端口,而不能从networking上的其他位置访问。

rndc用于pipe理名称服务器,例如“rndc reload”是告诉BIND您更改了区域文件并且应该重新加载它们的首选方法。

在我的Debian服务器上(不知道CentOS的情况),/etc/init.d/bind9也需要启动和停止服务。 我想CentOS把这个文件叫做/etc/init.d/named。 我不会禁用它或阻止它,而不检查该脚本如何工作。

您可以运行的命令的完整列表在BIND 9pipe理员参考手册 – pipe理工具中 。

至于为什么它使用TCP端口,运行“man rndc”的细节:

  rndc communicates with the name server over a TCP connection, sending commands authenticated with digital signatures. In the current versions of rndc and named, the only supported authentication algorithm is HMAC-MD5, which uses a shared secret on each end of the connection. This provides TSIG-style authentication for the command request and the name server's response. All commands sent over the channel must be signed by a key_id known to the server. rndc reads a configuration file to determine how to contact the name server and decide what algorithm and key it should use. 

所以如果你想保护它,请查看密钥和密钥文件的详细信息。 例如,/etc/bind/rndc.key(或/etc/named/rndc.key)应该具有有限的权限。

RNDC是远程pipe理端口。 不要把它打开到外面的世界。 除非您使用rndc实用程序,否则根本没有必要打开此端口,您可以安全地将其closures。

绑定需要UDP 53来服务正常的请求。 如果(且仅当)此服务器是区域的主服务器并且辅助服务器需要从中传输,则还应该打开TCP 53。

通常,不需要在边界防火墙上转发953端口的请求,但是将其作为本地服务在DNS服务器上打开(当然,如果您有ssh访问此服务器的话)是非常有效的。 正确configurationrndc是pipe理命名的一个很好的工具。