内网主机名解析相关类DNS协议记录
来自三线的随记
windows 内网解析主机名用到的相关协议
- MDNS
- LLMNR
- NBNS
- 路由器自己发现了设备,路由器解析的
Linux 开启 LLMNR支持
相关: systemd update :: https://linoxide.com/linux-how-to/install-systemd-centos-redhat/
My systemd-resolved install steps
[root@master-1 ~]# rpm -q systemd systemd-resolved systemd-219-57.el7.x86_64 package systemd-resolved is not installed
# yum install systemd-resolved Dependencies Resolved ============================================================================================================================================================= Package Arch Version Repository Size ============================================================================================================================================================= Installing: systemd-resolved x86_64 219-67.el7_7.2 updates 412 k Installing for dependencies: json-c x86_64 0.11-4.el7_0 base 31 k Updating for dependencies: cryptsetup-libs x86_64 2.0.3-5.el7 base 338 k systemd x86_64 219-67.el7_7.2 daocloud 5.1 M systemd-libs x86_64 219-67.el7_7.2 daocloud 411 k systemd-sysv x86_64 219-67.el7_7.2 daocloud 88 k Transaction Summary ============================================================================================================================================================= Install 1 Package (+1 Dependent package) Upgrade ( 4 Dependent packages) Total download size: 6.3 M
[root@master-1 ~]# rpm -q systemd systemd-resolved systemd-219-67.el7_7.2.x86_64 systemd-resolved-219-67.el7_7.2.x86_64
systemctl --now enable systemd-resolved
[root@master-1 ~]# ss -anptu | grep resolve udp UNCONN 0 0 *:5355 *:* users:(("systemd-resolve",pid=28108,fd=12)) udp UNCONN 0 0 [::]:5355 [::]:* users:(("systemd-resolve",pid=28108,fd=11)) tcp LISTEN 0 128 *:5355 *:* users:(("systemd-resolve",pid=28108,fd=14)) tcp LISTEN 0 128 [::]:5355 [::]:* users:(("systemd-resolve",pid=28108,fd=15))
注意
centos 需要 /etc/nsswitch.conf 中 hosts 需要添加 resolve 以开启 nss 模块
如
#hosts: db files nisplus nis dns hosts: files dns myhostname resolve
参考: