Apex domain vs www
Compare the apex domain and www along the stub resolver → recursive resolver → delegation → authoritative nameserver path. A recursive resolver can answer from cache, so a user response is not necessarily fetched directly from the authoritative server. TTL, record type and response code explain where the result came from and how long it can remain usable.
How to check the DNS result
Check the name and query type first, then the authoritative answer, then the chosen recursive resolver. NXDOMAIN, SERVFAIL, REFUSED and timeout represent different conditions. After a DNS change, compare authoritative data with several resolvers; clearing a local cache helps only when the stale answer is actually local.
The detail that matters
example.com is the zone apex while www.example.com is a separate hostname beneath it. Providers often support A/AAAA directly at the apex and CNAME for www; some offer proprietary flattening or ALIAS-like features. Decide separately whether HTTP should redirect one public hostname to the other. You can repeat the DNS check with 2ip domain information.