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.
- Load Terminal (Applications > Accessories > Terminal)
- Type in the following:
sudo service networking restart
- Press the Enter key
- Put in your password
Done. Enjoy your newly flushed DNS cache.