Tech tips & other words

Tag: Mac OS X (Page 1 of 4)

Clear Mac OS DNS cache via command line

The method for clearing or flushing the local cache in Mac OS has changed over the years. Here are all the Mac OS versions on one page that details how to clear Mac OS DNS cache via command line.

TLDR; Add this alias to your .zshrc file:

alias flushdns="sudo killall -HUP mDNSResponder;sudo killall mDNSResponderHelper;sudo dscacheutil -flushcache;say 'cache flushed' -v Tessa -r 229"

Then issue this command:

source ~/.zshrc

And now you can run this command and get nice audio confirmation:

flushdns

Clear your DNS cache on macOS Tahoe 26, macOS Sequoia 15, macOS Sonoma 14, macOS Ventura 13, macOS Monterey 12, macOS Big Sur 11, macOS 10.15 Catalina, macOS 10.14 Mojave, macOS 10.13 High Sierra, macOS 10.12 Sierra, OS X 10.11 El Capitan, OS X 10.10 Yosemite, OS X 10.9 Mavericks, OS X 10.8 Mountain Lion, OS X 10.7 Lion, OS X 10.6 Snow Leopard, and OS X 10.5 Leopard using the following Terminal commands:

Continue reading

Make your Mac chime at startup again

I miss the startup chime on my MacBook Pro. Make your Mac chime on startup again!

To enable it, open up terminal and type:

sudo nvram StartupMute=%00

To disable it, either reset your parameter RAM by pressing Command-Option-P-R at startup, or in terminal type:

sudo nvram StartupMute=%01

Clear the DNS cache on Mac OS

So you want to clear the DNS cache on Mac OS X Mavericks through the now-current Mac OS 26? Well, Mac OS  since ‘Mavericks’ has some DNS changes under the hood. Unlike previous versions, to effectively clear the cache you need to execute these two commands in Terminal:

dscacheutil -flushcache;sudo killall -HUP mDNSResponder

Add this as an alias to your .profile under something easy to remember like ‘flushdns’ and you’re good to go!

Now you know how to clear the DNS cache on Mac OS.

Test whether outbound port is open on Mac OS X 10.9, 10.8, 10.7

Wondering if a certain outbound port on your Mac is open or closed? Here’s a way to determine outbound open ports on Mac OS using netcat via the command line in terminal. We’ll use  using a free service from portquiz.net.

From the terminal, enter:

nc -v portquiz.net 443

where 443 is the port number you want to test.

Control-c will kill net cat after you get the info you want.

Easy-peasy. You can now determine outbound open ports on Mac OS.

« Older posts