Advertisement
buzzonit

TERMINAL HELP MAC

Dec 24th, 2017
386
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. TERMINALS HELPS
  2.  
  3. Clear DNS Cache in OS X Yosemite 10.10.4 & OS X 10.10.5
  4.  
  5. From OS X 10.10.4 moving onward to 10.10.5, including 10.11, Apple has ditched discoveryd and has replaced it (or rather, reverted back to) mDNSResponder. Thus, to clear DNS caches in OS X Yosemite 10.10.4, and 10.11 El Capitan, and presumably onward, the command string is as follows:
  6.  
  7. sudo dscacheutil -flushcache;sudo killall -HUP mDNSResponder;say cache flushed
  8. _____________________________________________________
  9.  
  10. Step 1: Launch Terminal, found in /Applications/Utilities/ or launched through Spotlight
  11.  
  12. Step 2: Type the following command at the prompt to backup hosts file to documents folder:
  13.  
  14. sudo cp /private/etc/hosts ~/Documents/hosts-backup
  15.  
  16.  
  17.  
  18. Step 3: Type the following command at the prompt to open hosts file:
  19.  
  20. sudo nano /private/etc/hosts
  21.  
  22.  
  23.  
  24. Step 4: Enter the administrator password when requested, you will not see it typed on screen as usual with the command line
  25.  
  26. Step 5: Once the hosts file is loaded within nano, use the arrow keys to navigate to the bottom of the hosts file to make your modifications
  27.  
  28. Step 6: When finished, hit Control+O followed by ENTER/RETURN to save changes to /private/etc/hosts, then hit Control+X to exit out of nano
  29.  
  30. Step 7: Verify your hosts modifications. You may need to clear DNS cache first.
  31.  
  32.  
  33.  
  34. If you want to restore the modified hosts to the backup of the original file use this command:
  35.  
  36. sudo cp ~/Documents/hosts-backup /private/etc/hosts
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement