How to Edit Hosts file in Mac OS X El Capitan

The hosts file is used by your computer to map hostnames to IP addresses.

By adding or removing lines to your hosts file you can change where certain domains will point when you access them in a browser or using other software. You can block certain hosts names, like ad-serving/malicious hosts, or used for web development purposes, i.e. to redirect domains to local addresses.

This is an important file and one that is under the computer administrator’s control, so you’ll need an account with full privileges to make any changes.

Making a backup of the hosts file can be a good idea if you plan on making significant changes or just want to play around with modifications and see what happens.

Step 1: Launch Terminal, found in /Applications/Utilities/ or launched through Spotlight

Step 2: Type the following command at the prompt to backup hosts file to documents folder:

sudo cp /private/etc/hosts ~/Documents/hosts-backup

Step 3: Type the following command at the prompt to open hosts file:

 sudo nano /private/etc/hosts

Step 4: Enter the administrator password when requested, you will not see it typed on screen as usual with the command line

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

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

Step 7: Verify your hosts modifications. You may need to clear DNS cache first.

If you want to restore the modified hosts to the backup of the original file use this command:

sudo cp ~/Documents/hosts-backup /private/etc/hosts

All credit goes to for this article.

Macbook Pro Retina (Late 2013) won’t shut down, just restarts! OS X Yosemite

I’ve recently been messing around with our Macbook Pro Retina (late 2013) as it won’t shut down anymore! If you choose to shut it down it closes down then just reboots. The battery life in standby also sucks, it can be fully charged at 100%, shut the lid, come back in 12 hours and it’ll be at 84%. I can’t remember if the problem was around before I upgraded from OS X Mavericks to Yosemite. I spent time on the phone with Apple tech support and they couldn’t sort the problem so booked me in at the local Apple Store. I had tried things like resetting the PRAM, verify the disk, repair disk permissions, reset the system management controller (SMC), wiped the drive and performed a fresh install and none of it solved the problem. Totally sounds like a software problem to me. By the way I have bootcamp installed with a windows partition. Windows can shutdown and power off the machine fine.

Took it to the Apple store for a ‘Genius’ to take a look. A few hours later I returned and they told me the Macbook looked like it had a little water damage, it’ll cost about £900 to change the motherboard, is it insured?!

I told them i’ve never spilt anything on it (which I haven’t) and that if it was a motherboard problem then why will windows shut the machine down correctly, sounds like a software problem to me?

They agreed and went back into their workshop to do a wipe and reinstall (which I had already done). 20 mins later, out they came, said it was shutting down correctly but was very slow at booting up for some reason, this could be down to the ‘water damage’ and sent me on my way!

I have since gone back to OSX Mavericks 10.9.5 and the machine shuts down correctly, battery standby life looks like it is acceptable but it’s still very slow at booting up and coming out of sleep mode.

I have 1 day left on the AppleCare warranty and a machine i’m not happy with. Thanks apple.

UPDATE 19/08/2015: I’m currently using OS X 10.11 Beta of El Capitan and it runs like a dream! Close the lid, come back a few days later and it will still be at 100%! It shuts down correctly, boots up quickly, everything works fine, no problems. Moral of the story… Yosemite sucks!


Apple Mac Startup Options

Startup shortcuts

Use these key combinations to change how your computer starts up. Press and hold the key or combination of keys immediately after starting your Mac until the expected function occurs or appears. For example, press and hold the Option key during startup until the Startup Manager appears.

Key or key combination What it does
Option or Alt Display all startup volumes (Startup Manager)
Shift Start up in Safe Mode
C Start from bootable media (DVD, CD, USB thumb drive)
T Start up in Target disk mode
N Start from a NetBoot server
X Force OS X startup (when non-OS X startup volumes are available)
D Use Apple Hardware Test
Command-R Use OS X Recovery (OS X Lion or later)
Command-Option-R Use Internet Recovery on supported computers
Command-V Start up in Verbose Mode
Command-S Start up in Single User Mode
Command-Option-P-R Reset NVRAM
Hold down the Media Eject (?) key, F12 key, or mouse or trackpad button Eject removable discs

Sleep, shut down, and log out shortcuts

Use these key combinations after your Mac has started up to sleep, shut down, log out of, or restart your computer.

Key or key combination What it does
Power button Tap to power on. Once powered on, tap the power button to wake or sleep your Mac.
Hold down the power button for 1.5 seconds Show the restart / sleep / shut down dialog
Hold down the power button for 5 seconds Force the Mac to power off
Control-Power button Show the restart / sleep / shut down dialog
Command-Control-power button Force the Mac to restart
Command-Option-Power button Put the computer to sleep
Command-Control-Power button Quit all apps (after giving you a chance to save changes to open documents), then restart the computer
Command-Option-Control-Power button Quit all apps (after giving you a chance to save changes to open documents), then shut down the computer
Shift-Control-Power button Put all displays to sleep
Command-Shift-Q Log Out
Command-Shift-Option-Q Log Out immediately

iPhone 4 Crackling During Calls on Vodafone

Over the past month or so I’ve had problems with my iPhone 4 crackling and the mic stop working when making or receiving calls. It started off doing it maybe once or twice a week but eventually got to a stage where it was nearly every call. I’d take or receive a call and anywhere between 0 – 60 seconds it would start crackling in the ear piece, get progressively louder then the person on the other end of the line couldn’t hear me at all and hang up! Continue reading →