Edit Hosts File#
Windows hosts file location
C:\Windows\System32\drivers\etc\hosts
Linux hosts file location
/etc/hosts
Flush DNS Cache#
Windows
ipconfig /flushdns
Linux with systemd
sudo systemd-resolve --flush-caches
macOS
sudo dscacheutil -flushcachesudo killall -HUP mDNSResponder
The hosts file allows you to map hostnames to IP addresses locally, overriding DNS resolution. Flushing DNS cache can help resolve DNS-related issues after making changes to DNS settings or hosts file.