大网数据广告活动
网站运营与故障问答

How to properly set up SRV DNS record?

· 52CE 我爱测

I'm setting up DNS server for my home network. It contains plenty of machines but I have only one public IP so there's a lot of NAT, proxies etc. Many people find it difficult to memorize all services provided by it. So i was loo…

问题原文

原帖链接 · Lapsio · CC BY-SA 3.0

I'm setting up DNS server for my home network. It contains plenty of machines but I have only one public IP so there's a lot of NAT, proxies etc. Many people find it difficult to memorize all services provided by it. So i was looking for some DNS record that would allow me to list all services available in the network. I found TXT but it seems to be a bit rough. More interesting option seems to be SRV record but I'm not really sure how it should be used.

If I'm providing lets say 5 tcp services - 3 www server, 1 ssh machine and 1 ftp server how SRV records should look like? Something like this?: ('im using bind9 server)

service.prot.host  class  RR  prio weigh port target
_tcp                IN    SRV    0 0    80    @    ; primary site
_tcp                IN    SRV    0 0    8081  site1
_tcp                IN    SRV    0 0    8082  site2
_tcp                IN    SRV    0 0    22    sshbox
_tcp                IN    SRV    0 0    23    ftp
;
_http._tcp          IN    SRV    0 0    80    @
_http._tcp          IN    SRV    0 0    8081  site1
_http._tcp          IN    SRV    0 0    8082  site2
_ssh._tcp           IN    SRV    0 0    22    sshbox
_ftp._tcp           IN    SRV    0 0    23    ftp
;
_tcp.site1          IN    SRV    0 0    8081  site1
_http._tcp.site1    IN    SRV    0 0    8081  site1
_tcp.site2          IN    SRV    0 0    8082  site2
_http._tcp.site2    IN    SRV    0 0    8082  site2
_tcp.sshbox         IN    SRV    0 0    22    sshbox
_ssh._tcp.sshbox    IN    SRV    0 0    22    sshbox
_tcp.ftp            IN    SRV    0 0    23    ftp
_ftp._tcp           IN    SRV    0 0    23    ftp

It looks quite illegible... Is it really how it should be set up? I mean there's a ton of duplicates in fact... Are any of those redundant? There are only 5 services and when I'm providing like 20 or more at home it's going to be hell of configuration...

已采纳解答

原帖链接 · Chris Rutherfurd · CC BY-SA 3.0

SRV records are meant for services which are designed to check for the existence of service records such as connecting to an XMPP server or a SIP server. DNS should not be used to provide a list of services for end users on your network to browse as DNS is not designed for users to directly read.

The best option is to add the information you need for users to identify the services on your network to an intranet page on your local network or other such publications your users can see them with.

As an example if you where to try to create an SRV record of...

_ftp._tcp.example.com it wouldn't work as the FTP protocol isn't designed to work with SRV records whereas if you where to create one for _sip._tcp.example.com this would work as the SIP protocol is designed to work with SRV records so that when you try to connect to a SIP address at example.com it will automatically look for the _sip._tcp.example.com SRV record to identify the DNS record for the specific SIP server which may be some-sip-machine.example.com.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2016-06-11)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。