understanding resolv.conf nameserver through system calls [closed]

Solution 1:

Presumably your resolv.conf includes nameserver 127.0.1.1.

When pinging google.com in your example this name first needs to be looked up so that ping knows an IP address which it can send the ICMP echo request packets to.

To find the IP address it consults the configured nameserver, hence why it communicates with 127.0.1.1 on 53/udp.