我为 esnp4s0f0 接口添加了一个 IP 地址 1.1.1.2/24。并向 1.1.1.1 发送 ping
为什么 arp 表显示为一一一一而不是简单的 1.1.1.1??
root@testbed:~# arp
Address HWtype HWaddress Flags Mask Iface
192.168.10.225 ether 00:0c:29:bc:3e:68 C eno3
10.250.0.4 ether 52:54:00:4d:7e:fe C br1
one.one.one.one ether 02:10:18:cc:9e:6c C enp4s0f0
我不记得添加过某种 DNS 条目。
答案1
您没有输入 DNS 条目并不重要,因为您使用的是公共 IP 地址,而不是保留的私有 IP 地址。您的 arp 命令正在执行 DNS 查找并获取 IP 地址的实际答案。如果您想抑制 DNS 查找,请执行arp -n
。
例子:
doug@DOUG-64:~$ nslookup one.one.one.one
Server: 127.0.0.1
Address: 127.0.0.1#53
Non-authoritative answer:
Name: one.one.one.one
Address: 1.1.1.1
Name: one.one.one.one
Address: 1.0.0.1
doug@DOUG-64:~$
doug@DOUG-64:~$ nslookup 1.1.1.1
Server: 127.0.0.1
Address: 127.0.0.1#53
Non-authoritative answer:
1.1.1.1.in-addr.arpa name = one.one.one.one.
Authoritative answers can be found from:
1.1.1.in-addr.arpa nameserver = ns3.cloudflare.com.
1.1.1.in-addr.arpa nameserver = ns7.cloudflare.com.
ns3.cloudflare.com internet address = 162.159.7.226
ns3.cloudflare.com internet address = 162.159.0.33
ns3.cloudflare.com has AAAA address 2400:cb00:2049:1::a29f:21
ns3.cloudflare.com has AAAA address 2400:cb00:2049:1::a29f:7e2
ns7.cloudflare.com internet address = 162.159.6.6
ns7.cloudflare.com internet address = 162.159.4.8
ns7.cloudflare.com has AAAA address 2400:cb00:2049:1::a29f:408
ns7.cloudflare.com has AAAA address 2400:cb00:2049:1::a29f:606