2ndalpha / gasmask

Hosts file manager for OS X
3.71k stars 250 forks source link

The hosts file is cached. #108

Open mkormendy opened 7 years ago

mkormendy commented 7 years ago

Switching to a different hosts file with Gas Mask often doesn't have any effect because the host file is cached by the system. It might be nice to implement a button that refreshes the mDNSResponder with the following command:

sudo killall -HUP mDNSResponder

SchmyeBubbula commented 7 years ago

Flush DNS cache

-- OS X El Capitan 10.11 and Yosemite 10.10.4 and 10.10.5 sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

-- OS X Yosemite 10.10 and 10.10.1 and 10.10.2 and 10.10.3 sudo discoveryutil mdnsflushcache; sudo discoveryutil udnsflushcaches

-- OS X Mavericks 10.9 dscacheutil -flushcache; sudo killall -HUP mDNSResponder

-- OS X Lion 10.7 and Mountain Lion 10.8 sudo killall -HUP mDNSResponder

-- OS X Leopard 10.5 and Snow Leopard 10.6 dscacheutil -flushcache

-- OS X Tiger 10.4 and Panther 10.3 lookupd -flushcache

mkormendy commented 7 years ago

Thanks @SchmyeBubbula! Even better, a list of the different commands to run for each OS version!