Flush DNS

From DreamHost
Jump to: navigation, search

Overview

Most operating systems are designed to cache DNS records. This is generally a good practice as it allows faster requests to a web site, but if DNS has recently changed, it may be necessary to flush the cache on your computer in order to retrieve the new DNS records. What this does is remove the local cache from your system and allow you to grab the most recent cache that your ISP is using.

Flushing the DNS records on your computer is very useful when trying to speed up DNS resolution for a newly added or modified domain on your account.

This wiki provides detailed instructions for flushing the cache on different operating systems.

Flushing your DNS cache in Windows

Windows XP

  1. Click the Start button and then click Run.
  2. Type in cmd and click OK.
  3. In the window that comes up, enter:
    ipconfig /flushdns
  4. Press the 'Enter' key and repeat the process two more times.
  5. Type exit, and then press the 'Enter' key to close the window.

Windows Vista

  1. Click the Start button.
  2. In the menu, select ‘All Programs’.
  3. Click Accessories.
  4. Right click on ‘Command Prompt’.
  5. Select the option ‘Run As Administrator’.
  6. In the window that opens, type the following, and then press 'Enter':
    ipconfig /flushdns
  7. Press the 'Enter' key and repeat the process two more times.
  8. Type exit, and then press the 'Enter' key to close the window.

If you wish to instead verify what domains and IPs your computer currently has cached, you may use the command ipconfig /displaydns in the steps described above.

Windows 7

  1. Click the Start button, and then type 'cmd' in the search bar (where it says 'search for programs and files').
  2. In the command prompt that pops up, enter:
    ipconfig /flushdns
  3. Press the 'Enter' key, and then repeat the process two more times.
  4. Type exit, and then press the 'Enter' key to close the window.

Windows 8

  1. Click the Windows logo while holding the R key at the same time.
    The run box appears.
  2. In the run box, type cmd and then hit the 'Enter' key.
  3. In the command prompt that pops up, enter:
    ipconfig /flushdns
    The command runs and returns to the prompt.
  4. Type exit, and then press the ‘Enter’ key to close the window.

Flushing your DNS cache in Mac OS X

OS X 10.4 (Tiger)

  1. Open up a terminal window (Located in /Applications/Utilities).
  2. To flush your DNS cache, enter the following command:
    lookupd -flushcache
  3. Type logout, and then press the 'Enter' key to close the window.

OS X 10.5 (Leopard) and 10.6 (Snow Leopard)

  1. Open up a terminal window (Located in /Applications/Utilities).
  2. To flush your DNS cache, enter the following command:
    dscacheutil -flushcache
  3. Type logout, and then press the 'Enter' key to close the window.

OS X 10.7 (Lion) and 10.8 (Mountain Lion)

  1. Open up a terminal window (Located in /Applications/Utilities).
  2. To flush your DNS cache, enter the following command:
    sudo killall -HUP mDNSResponder
  3. Type logout, and then press the 'Enter' key to close the window.

OS X 10.9 (Mavericks)

  1. Open up a terminal window (Located in /Applications/Utilities).
  2. To flush your DNS cache, enter the following command:
    dscacheutil -flushcache; sudo killall -HUP mDNSResponder
  3. Type logout, and then press the 'Enter' key to close the window.

OS X 10.10 (Yosemite)

  1. Open up a terminal window (Located in /Applications/Utilities).
  2. To flush your DNS cache, enter the following command:
    sudo discoveryutil udnsflushcaches
  3. Type logout, and then press the 'Enter' key to close the window.

Flushing your DNS cache in Linux

Most current Linux distributions do not use a DNS resolver cache in the same way that Windows and Mac OS X use. To confirm which particular daemon is installed for your Linux distribution, check the website or its forum pages.

However, a common DNS caching application sometimes used is the Name Service Caching Daemon (nscd). It’s most likely not installed by default so there is no need to flush the cache. But, if you’ve already installed it you can flush the cache by running the following command in a terminal:

sudo service nscd restart

Alternatively, you can try these commands:

/etc/rc.d/init.d/nscd stop
/etc/rc.d/init.d/nscd start

Further recommendations

  • When exiting the Windows command prompt, you may see a pop-up box claiming that Windows "...cannot end the program as it may still be running..." – it's completely safe (and required) to click the End Now button to exit.
  • Make sure that you have closed any browser windows that are open, as they'll continue to read from the previous cache that was loaded into memory. Then, restart the browser and attempt to view your site. Allow a reasonable amount of time (generally a couple of hours), and then you should be able to see your site online. If not, it's very likely that your ISP has not updated its DNS cache; it's not possible to get around this without making some hosts file modifications.
  • Alternatively, you can use a third-party DNS server such as OpenDNS which allows you to manually ask it from their website to update the cache of any domain. In order for this to work, you must manually change your computer's configuration to use a third-party DNS server; bear in mind that it may not be possible or recommended to use a third-party DNS server in some business environments.
  • DreamHost support is unable to assist in DNS propagation issues as it is generally the customer's responsibility.
  • DNS changes may take up to 72 hours to complete – If you notice your site not working after that time, contact support on the (Panel > ‘Support’ > ‘Contact Support’) page.