TL;DR: How to flush the DNS cache and test name resolution
The fix only. No explanation, no diagnosis. Read the full article if any of this does not match what you are seeing.
- Check what it resolves now:
Resolve-DnsName www.example.com(Windows),getent hosts www.example.comordig www.example.com(Linux, macOS). - Windows, elevated prompt:
ipconfig /flushdns(orClear-DnsClientCachein PowerShell). - macOS, administrator account:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder- Linux with systemd-resolved:
sudo resolvectl flush-caches. Many Linux systems have no cache, so there is nothing to flush. - Compare with the server itself:
Resolve-DnsName www.example.com -Server 8.8.8.8ordig @8.8.8.8 www.example.com.
If the server returns the wrong answer, flushing the client changes nothing. Fix the record or the server.
Also check the hosts file and the browser's secure DNS (DNS over HTTPS) setting.