They both mean that a DNS record is not found but they have different scope. NODATA response rcode is NoError, not nxdomain yet the answer is still negative, like http 404. To understand the difference, read this short rfc https://datatracker.ietf.org/doc/html/rfc2308
Also, I would point to an excellent series around this subject of Linux application obtaining network address from the DNS, covers gnu libc and musl:
Negative DNS responses are possible in two forms:
1. nxdomain and a
2. NODATA response.
They both mean that a DNS record is not found but they have different scope. NODATA response rcode is NoError, not nxdomain yet the answer is still negative, like http 404. To understand the difference, read this short rfc https://datatracker.ietf.org/doc/html/rfc2308
Also, I would point to an excellent series around this subject of Linux application obtaining network address from the DNS, covers gnu libc and musl:
https://biriukov.dev/docs/resolver-dual-stack-application/0-...