When URL’s are just not resolving the way you want it, time to clear or “flush” the dns nameserver local cache.
How to clear the local DNS cache? Open terminal and type the following command for your appropriate OS X Version:
Note: Updated on January 13, 2018:
macOS 10.13
sudo killall -HUP mDNSResponder; sleep 2; echo macOS DNS Cache Reset
macOS 10.12
sudo dscacheutil –flushcache; sudo killall –HUP mDNSResponder
OS X 10.11
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
OS X 10.10
sudo discoveryutil udnsflushcaches
OS X 10.9
dscacheutil -flushcache; sudo killall -HUP mDNSResponder
OS X 10.7 & 10.8
sudo killall -HUP mDNSResponder
OS X 10.5 & 10.6
sudo dscacheutil -flushcache
You may need to enter your password.
Are you a Windows or Linux user? No problem, here’s some love:
Windows
ipconfig /flushdns
Linux (Depending on your distro)
/etc/init.d/named restart
/etc/init.d/nscd restart