The domain name debian.debian point to 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
Scan my localhost to get different result, why?
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
I knew why debian.debian point to 127.0.1.1.
Update:to add a question
Why http service is running on both 127.0.0.1 and 127.0.1.1?Why other services are running only on 127.0.0.1 instead of 127.0.1.1?
sudo netstat -lnt.