nmap 我的本地主机与主机名和 IP 以获得不同的结果

nmap 我的本地主机与主机名和 IP 以获得不同的结果

域名debian.debian指向127.0.0.1

$ ping debian.debian
PING debian.debian (127.0.1.1) 56(84) bytes of data.
64 bytes from debian.debian (127.0.1.1): icmp_seq=1 ttl=64 time=0.047 ms
64 bytes from debian.debian (127.0.1.1): icmp_seq=2 ttl=64 time=0.046 ms

扫描我的本地主机得到不同的结果,为什么?

debian@debian:~$ sudo nmap  debian.debian
Starting Nmap 7.80 ( https://nmap.org ) at 2022-10-15 09:56 HKT
Nmap scan report for debian.debian (127.0.1.1)
Host is up (0.0000050s latency).
Not shown: 999 closed ports
PORT   STATE SERVICE
80/tcp open  http

Nmap done: 1 IP address (1 host up) scanned in 0.09 seconds

debian@debian:~$ sudo nmap  127.0.0.1
Starting Nmap 7.80 ( https://nmap.org ) at 2022-10-15 09:56 HKT
Nmap scan report for localhost (127.0.0.1)
Host is up (0.0000050s latency).
Not shown: 995 closed ports
PORT     STATE SERVICE
25/tcp   open  smtp
53/tcp   open  domain
80/tcp   open  http
631/tcp  open  ipp
5432/tcp open  postgresql

Nmap done: 1 IP address (1 host up) scanned in 0.11 seconds

我知道为什么debian.debian指向127.0.1.1.
更新:添加一个问题
为什么http服务同时在127.0.0.1和127.0.1.1上运行?为什么其他服务只在127.0.0.1而不是127.0.1.1上运行?

相关内容