How to Flush the DNS Cache

This guide explains how to flush the DNS cache on your computer to force it to recognize the new IP address of your LockSelf instance.


Windows

  1. In the taskbar search box, type "Command Prompt"
  2. Right-click on Command Prompt and select "Run as administrator"
  3. When prompted to allow Command Prompt to make changes to your computer, select Yes
  4. In the Command Prompt window that opens, type the following command and press Enter:
ipconfig /flushdns
  1. You should see the message: "Windows IP Configuration – Successfully flushed the DNS Resolver Cache."
  2. Close the Command Prompt

macOS

  1. Close all browser windows
  2. Open Terminal:
    • Press ⌘ Command + Spacebar simultaneously to open Spotlight
    • Or click the magnifying glass 🔍 in the top-right corner
    • Type "terminal"
    • Click Terminal
  3. In the Terminal window, type the command for your macOS version:

macOS 10.11 and later (El Capitan, Sierra, High Sierra, Mojave, Catalina, Big Sur, Monterey, Ventura, Sonoma)

sudo killall -HUP mDNSResponder

macOS 10.10 (Yosemite)

sudo discoveryutil mdnsflushcache

macOS 10.7 to 10.9 (Lion, Mountain Lion, Mavericks)

sudo killall -HUP mDNSResponder

macOS 10.6 and earlier

sudo dscacheutil -flushcache
  1. Press Enter
  2. Enter your administrator password when prompted (characters will not appear on screen; this is normal)
  3. Press Enter again
  4. Close Terminal

Linux (Ubuntu/Debian)

If you are using systemd-resolved (default on Ubuntu 18.04+):

sudo systemd-resolve --flush-caches

If you are using nscd:

sudo /etc/init.d/nscd restart

Why flush the DNS cache?

Your computer keeps domain name and IP address mappings in memory to speed up browsing. When the IP address of your LockSelf instance changes (for example, during a failover to a backup environment), you need to clear this cache so your computer uses the new IP address.


Verification

After flushing the DNS cache and applying the IP change, you can verify that your computer is using the new address by opening a Terminal (macOS/Linux) or Command Prompt (Windows) and typing:

nslookup your-domain.com

The displayed IP address should match the new IP communicated by our support team.


Updated