How to clear DNS cache on a Macintosh computer

Tags dhcp dns mac

All computers connected to the Internet use a DNS (Domain Name Service) server. Every time you go to a website, your computer's operating system needs to look up the site's IP address using the domain name (DN) of the website. To improve the performance, computers store the answers that a DNS server sends by adding them to its own internal database and retains them for a period of time. Storing these responses is called caching. If you are on a website, and want to retrieve the next page on the site, your machine does not have to look up the host again.

Unfortunately DNS caching is a double-edged sword. It speeds up resolution by storing recent answers, and short-circuiting the normal resolution process. Because your computer caches the answers from DNS server and does not delete these answers until the "time to live" expires, it can take hours or days for it to recognize changes to DNS information for any website. In order to address this, you will need to clear your computer's local DNS cache when instructed by the Service Desk Consultant.

To clear the DNS cache on a Macintosh

1.  Open your "Applications" folder, then open your "Utilities" folder

2.  Double-click on the "Terminal" icon

3.  At the command prompt, type in the following and press Enter:

For computers running Macintosh OS X 10.4 and older:

               lookupd -flushcache

For computers running Macintosh OS X 10.5 and newer:

               dscacheutil -flushcache