Currently only live test. The below is my test result and there are some difference.
```
// Original
$ getent hosts 127.0.0.1
127.0.0.1 localhost localhost.my.domain
$ getent hosts ::1
::1 localhost localhost.my.domain
$ getent hosts 12321
0.0.48.33 12321
$ getent hosts 18472318947123894781239034534253425423
169.13.243.15 18472318947123894781239034534253425423
$ getent hosts www.google.com
2404:6800:4012:4::2004 www.google.com
142.251.42.228 www.google.com
$ getent hosts 142.251.43.4
142.251.43.4 tsa03s08-in-f4.1e100.net tsa03s08-in-f4.1e100.net
```
```
// Revised
$ getent hosts 127.0.0.1
127.0.0.1 localhost
$ getent hosts ::1
::1 localhost
$ getent hosts 12321
0.0.48.33 12321
$ getent hosts 18472318947123894781239034534253425423
169.13.243.15 18472318947123894781239034534253425423
$ getent hosts www.google.com
172.217.163.36 www.google.com
2404:6800:4012:3::2004 www.google.com
$ getent hosts 142.251.43.4
142.251.43.4 tsa03s08-in-f4.1e100.net
```
The revised code shows the output of `getent hosts` for various IP addresses and domain names, highlighting differences compared to the original output. Notably, the revised code does not include the alias "localhost.my.domain," which was present in the original output for localhost. It is because `struct addrinfo` don't have alias. And the order of IPv4 and IPv6 address is a revers.
There are other difference is like below.
```
//Orgin
$ getent hosts www.yahoo.com
2406:2000:a0:807::2 www.yahoo.com
180.222.106.12 www.yahoo.com
// Revised
kola@freebsd:/usr/src/usr.bin/getent $ getent hosts www.yahoo.com
180.222.106.12 www.yahoo.com
180.222.109.252 www.yahoo.com
180.222.106.11 www.yahoo.com
180.222.109.251 www.yahoo.com
2406:2000:a0:807::1 www.yahoo.com
2406:2000:9c:800::12 www.yahoo.com
2406:2000:a0:807::2 www.yahoo.com
2406:2000:9c:800::11 www.yahoo.com
```
It seem `getaddrinfo` will return more IP than the orgin `gethostby*` functions. I am not sure if this is correct?