|
|
#1 |
|
Flush DNS cache changed in Lion
After a bit of beating my head against the wall yesterday, trying to flush out the local resolver cache, I finally learned it has changed a bit under Lion.
In 10.6, and prior, the method was to issue dscachutil -flushcache from a Terminal prompt. This no longer works, as I learned trying to flush an Address record I knew had changed (because I changed it myself on one of my domains). The new record had propagated on the Internet, and dig was getting the proper response from various external servers. But anything using the local resolver cache kept getting the old IP address, even after "flushing" with the old command. I tracked it down by doing a dump of the local cache into system.log sudo killall -INFO mDNSResponder before and after using the old flush command. The old record remained in the cache, along with lots of others. I dragged out my 10.6.8 external disk and booted from it. When you issue the old command (dscacheutil -flushcache) under 10.6, the following line is logged to system.log: Oct 16 10:37:54 helios mDNSResponder[12]: SIGHUP: Purge cache and of course the cache is flushed. Using the old command under 10.7, there is no "Purge cache" being logged, and the cache remains intact. What works under 10.7 is: sudo killall -HUP mDNSResponder That logs the purge, and flushes the cache. |
|
|
|
0
|
|
|
#2 | |
|
Quote:
-Kevin
__________________
2010 Mac Pro 2.8 Quad, 27" ACD - MacBook 2.4 GHz
|
||
|
|
0
|
|
|
#3 |
|
Flush cache
Hello,
I've used this command before as you said and it worked fine, now I am trying to do the same in another computer (Mac 10.7 Lion as well) and it isn't working. I keep getting the old results. Can you help me??? Thank you so much |
|
|
|
0
|
|
|
#4 | |
|
Quote:
I just tried my two systems again (updated to 10.7.2 now), and this Terminal command still works here: sudo killall -HUP mDNSResponder The easiest way to see if it worked (easier than examining the cache contents), is to open Console, look at system.log, and look for a line similar to this resulting from the command: Nov 13 15:12:48 helios mDNSResponder[12]: SIGHUP: Purge cache You might really be flushing the local resolver (on that workstation), but perhaps your router is also caching records in its name server? I don't know if home routers do that as normal procedure, as I don't regularly use their (the routers') DNS services. |
||
|
|
0
|
|
|
#5 |
|
flush cache
Thank you for the quick answer. Well, I did what you said and it appears as you mentioned. Actually, it worked but as soon as I went online it went back to the old numbers again.
I am not really an expert...:-) |
|
|
|
0
|
|
|
#6 |
|
Thank you
I was searching for a reason why Lion flushdns did not work. THANK YOU!
|
|
|
|
0
|
|
|
#7 |
|
Had to use Lion command on Snow Leopard?
Strangely, I had to use the killall command on Snow Leopard (10.6.8) to get the cache to flush - the dscacacheutil command wouldn't work. I've used that command plenty of times in Snow Leopard, but probably with earlier versions. Could it be that Snow Leopard and Lion both use the new command now? Or is there something else about system configuration that requires one vs. the other?
|
|
|
|
0
|
|
|
#8 |
|
It appears the dscacheutil command is simply a shortcut to the killall -HUP method. The giveaway is what is logged on a successful flush, identical by either method:
Oct 16 10:37:54 helios mDNSResponder[12]: SIGHUP: Purge cache I am unsure why it (dscacheutil) doesn't work for you on Snow Leapord; it does for me, and does not on Lion. Perhaps there is another reason besides simply OS version? I am wondering if dscacheutil -flushcache works for anyone on Lion? I tried it on two Lion installs, but though they are different hardware, they are both set up identically to my liking, and maybe that has something to do with it? At any rate, it is hardly ever super-useful, as the records can be cached several places. |
|
|
|
0
|
|
|
#9 |
|
Snow Leopard vs Lion
I wonder if dscachutil fails silently if you don't use sudo? I'll have to try that next time I get a chance.
|
|
|
|
0
|
|
|
#10 |
|
In my testing under 10.7.3 'sudo dscachutil -flushcache' doesn't work (no pause while cache is flushed, no log of purge as when the killall method is used) but the killall method does.
Just as an aside, I also found that MainMenu v2.1.2 (1412)'s Flush DNS option works under 10.6 and 10.7 |
|
|
|
0
|
|
|
#11 |
|
Anytime you'd like to spell it correctly, there is the option of typing:
dscacheutil -flushcache |
|
|
|
0
|
|
|
#12 | |
|
Quote:
sudo killall -HUP mDNSResponder As HenryAZ stated... Also, that command works as stated on my Mac Pro (Early 2008) running Mac OS X 10.7.3. Here is the output to "/var/log/system.log": May 9 01:13:10 Mac-Pro mDNSResponder[36]: SIGHUP: Purge cache S-
__________________
Mac Pro: 8-core 2.8 GHz, 10GB RAM, OS X 10.8.2; iPhone 5 32GB iOS 6.1 |
||
|
|
0
|
|
|
#13 | |
|
Quote:
sudo killall -HUP mDNSResponder S-
__________________
Mac Pro: 8-core 2.8 GHz, 10GB RAM, OS X 10.8.2; iPhone 5 32GB iOS 6.1 |
||
|
|
0
|
|
|
#14 |
|
Warning?
When I entered the "sudo.." command I receive the following warning...
WARNING: Improper use of the sudo command could lead to data loss I'm currently a novice at all of this, so just want to make sure I'm not doing something wrong before I enter my password and ruin my system! |
|
|
|
0
|
|
|
#15 | |
|
Quote:
Everyone gets that message the first time they run sudo, it's normal and not in itself something to worry about. However, running sudo is dangerous if you're not sure what you're doing. |
||
|
|
1
|
|
|
#16 |
|
Right - it's a legacy message that's been around much longer than the Mac. For most average users, you can muck things up much worse without sudo. In the worst case, you have to reinstall the OS, but say, you drag your iPhoto lib to the trash and you're not backed up - you're really hosed then.
|
|
|
|
0
|
![]() |
|
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| thread | Thread Starter | Forum | Replies | Last Post |
| iTunes 10.4 Mobilesync Location Changed in Lion? | xUNDEROATHx21 | Mac OS X 10.7 Lion | 3 | Dec 24, 2011 02:36 AM |
| Need help when changing the name of the home directory folder in Lion | huntert93 | Mac OS X 10.7 Lion | 3 | Sep 20, 2011 05:31 PM |
| Constant need to flush DNS cache | jakobox2 | Mac OS X | 2 | Aug 25, 2011 07:33 AM |
| How to password protect/secure external HD in OSX? Changes in Lion? | miamialley | Mac OS X | 2 | Jul 27, 2011 10:09 PM |
| How to make a blank password in Lion | Mattsnurb | MacBook Pro | 2 | Jul 21, 2011 10:51 AM |
All times are GMT -5. The time now is 07:02 PM.







2010 Mac Pro 2.8 Quad, 27" ACD -
Linear Mode

