Start with the system view

getent follows the configured system name-resolution mechanism. dig makes a DNS query. Comparing the two can reveal a hosts entry, a different resolver, or another source of data.

shell
getent ahosts example.org
dig example.org A
dig example.org AAAA

Ask a named resolver

Choosing a DNS server explicitly makes the check reproducible. Record the query type, response status, TTL, and responding server. A missing AAAA record does not mean that an A record is missing.

shell
dig @1.1.1.1 example.org A
dig @8.8.8.8 example.org A

# Compare status, TTL, and the SERVER line.

Give the cache a clear boundary

Both positive and negative answers can be cached. After a record changes, compare authoritative and recursive answers before changing several settings at once. A TTL describes a particular record in a particular cache.

Further reading

BIND dig manual ↗