Clearing DNS cache in Mac OS X

When one visits a website (domain name) the resolved IP address of the website gets cached. Now, if you are the one who plays with the site’s Name Servers then probably you would have faced the situation where the older IP address gets cached and so you are sent to the old website on subsequent attempts. Most of the times since the Name Servers take time to propagate its all the more confusing. It’s happened to me twice and so here I post this note to help troubleshoot the issue.

Consider is the domain you are troubleshooting.

So here is what you can do when you type in the address bar of the browser and the old website shows:

First make sure that your name servers have been updated appropriately in your domain’s control panel.

Clear the browser cache:

This is the simplest to clear. Hit ‘Apple+R’ to clear the cache in Safari. Try visiting the site again. Stop if it works fine.

Clear the system level cache:

$ lookupd -flushcache in OS X 10.4 and
$ dscacheutil -flushcache in OS 10.5.

Now, clear the browser cache and try again. Stop if it works fine and write me a comment below :).

Override ISP level chache: If its still not cleared off then it means that its been cached at the ISP’s side. You can take a look at the output of the ‘dig’ command.

$ dig

Take note of the various sections therein. The IP Address (ANSWER SECTION) and name servers (AUTHORITY SECTION) should be listed correctly. If not, which means the lookup has been cached at the ISP’s side name servers mentioned in /etc/resolv.conf.

To override this you would need to edit the /etc/hosts file directly.

Append an entry ‘ ‘ to the file.

Now, reload the Netinfo db.

$ sudo niload -v -m hosts . < /etc/hosts

Clear the above two caches and try again. Stop if it works and write me a big good thank you note. I saved you a lot of time ;)

If you still haven't got it to work then you can try one last thing. Send a HUP to the lookupd process.

$ ps auxw | grep lookupd
root 325 0.0 0.1 29204 1444 ?? Ss 5:56PM 0:00.25 /usr/sbin/lookupd
$ sudo kill -HUP 325

Check again while you keep your fingers crossed. If it works perfect, I have saved your day ;). Write me a Thank you email :).

The last thing did the trick for me. Once before 'Clearing the system level cache' was good enough.

Hope this helps someone to save some productive hours.

Small details = Big Impact.

Using the MacBook is a real delight. It feels good and its only after time that you realize that the small design decisions made by Apple really have a big impact on usability.

MacBook size - source Apple (
The MagSafe connector is held magnetically in place. One just needs to get the connector near the socket in the laptop and it clings to it. No more adjusting to get it in right. When its tugged accidentally it just comes-off easily without pulling your laptop. So no need to worry about someone accidentally tripping over and getting your MacBook off the desk.

At 1280 x 800 the screen size is just perfect. I face no problems when it comes to browsing websites or coding. The default text size is also perfect and very near to the size I was used to. The contrast and saturation seems proper. I haven’t got the time to watch a DVD but will test that soon. The glossy screen has its own issues especially the narrower viewing angle. May be thats true with all glossy screens.

Form factor:
MacBook - source Wikipedia
I find 15″ widescreen laptops too bulky to carry around. I didn’t want to think twice before I carry my laptop in my backpack. Also, 15″ widescreen laptops are not handy when it comes to moving or changing your posture. So, during my search for a laptop I was very clear of not opting for a 15″ widescreen laptop. I found the 14.1″ widescreen laptops handy and manageable. I must say I was a little doubtful whether 13.3″ would be right for me. Now I find the form factor of Xen just the way I wanted it to be. Its sleek (at 1.08″), light (at 5.1 pounds) and feels just right.

mac keyboard
The keyboard of the MacBook is different than any of the other laptops(ibm, lenovo, hp, compaq, dell) which I have used. They are square, flat on the top and of the same width and height at the top and the base. It felt different to begin with but soon I was comfortable with the keyboard and I kinda like it now. I just love the mild sound of the keys and the slight resistance when I press them. Feels different, feels good.

Trackpad is neat with a trademark Apple style single click button. It didn’t take time for me to get used to. Now, I find it very usable. The best feature is the scroll. To right-click tap two-fingers on the trackpad and to scroll I just roll two fingers on the trackpad.

It has built-in Gigabit Ethernet, Wifi and Bluetooth. Has been sufficient for my needs. This doesn’t have a PCMCIA or a ExpressCard slot which is a limitation. Other than that its awesome. Not much configuration required its just works out of the box. Internet connection sharing can be configured over Ethernet, Firewire or WiFi. I tried it over Ethernet it was simple, few clicks thats it.

Battery Life:
The battery has a cute looking battery life indicator. You can check the battery life by click a button on the battery even when its disconnected from the MacBook. Officially Apple endorses the battery life of the MacBook to be 6 hours. Is it true? To everyones surprise, I would say, “YES, nearly.” I use the Internet (on Wifi), Firefox (gmail + atleast 15 tabs open), Textmate (sorry Emacs lovers, I am just giving Textmate a fair try), Terminal, Quicksilver, MySQL server, Apache and Bluetooth (OFF). So, under normal operation I get a battery life of aprroximately 3.5 – 4 hours. Isn’t that great? But its still not 6 ours! Fine, one more story to tell. I had kept my MacBook ON one night downloading stuff from the Internet. I had closed all the applications except Firefox, WiFi was ON, monitor was OFF. I got up to check the download after 4.5 hours and it was still downloading with another 2 hours of battery life to go and estimated 1.x hr of download time remaining. Later, when I got up from sleep the MacBook was asleep, the download had finished and another 31 minutes of battery life remaining. How long is the battery life?

Don’t you agree “Small details = Big Impact”?