As a web developer, I’m always having to work with DNS. Anyone who has dealt with DNS will tell you that caching is simultaneously a great thing and a horrible thing.

Today, I made a mistake with the IP address of a new host, and I needed to flush my DNS cache so that my machine would go and grab the new IP address. I hadn’t done this in Ubuntu before, so I had to figure it out. Fortunately, it’s really easy.

  1. Load Terminal (Applications > Accessories > Terminal)
  2. Type in the following:
    sudo service networking restart
  3. Press the Enter key
  4. Put in your password

Done. Enjoy your newly flushed DNS cache.

Did I help you? Send me a tip.