Manually Override DNS -Window, Linux and Mac Examples


First off, let me explain what a DNS Entry is in order for us to understand why we would need to override it. Basically a DNS entry is a record or entry that tells us what ip address is of a domain will point to. Such as an example (not actual) IP of could point to a domain such as

Say perhaps we are updating a DNS entry and as the nature of DNS would have it, sometimes it will take up to 48 hours for the DNS to propagate through the Internet. Or perhaps we don’t want to update a DNS record which could affect everyone but rather just change a record for ourselves, locally. In these case, we can manually override the DNS change which will only reflect on our local machine. Below I will show you how to achieve this on Windows, Linux and Mac.

Manually Override DNS on Windows

Open up the hosts file located under “C:\Windows\System32\etc\drivers\“. In there you will see the IP address in the left column and a space separated list of domains to the right. The below example will set the 3 domains of, and to the IP address of

Manually Override DNS on Linux

vi the hosts file which is located under /etc/hosts. Add in a line below the last entry in the same fashion as you would for windows. For example if you wanted to change the ip address for the domain to point to you would enter:

Manually Override DNS DNS on Mac

Mac is the same as the above linux example. Simply edit the hosts file under /etc/hosts and add in the entries as needed. So again, you could enter something such as:

Manually Override DNS Using IPV6

You don’t always have to use a standard IPV4 as the IP address. You can also use IPV6 and enter it into any of the hosts files like so:

fe80::1%lo0 localhost

And that is all there is in Manually Override DNS in windows, linux and mac.

Using Curl As A Wget For Mac Replacement


I was trying to download a file on my Mac and realised that there is no wget for Mac. Since I consistently use wget I decided to find a way to get wget for mac. I found a quick way to create an fake wget command by creating an alias of curl. By creating the alias, I am able to call ‘wget’ and it will invoke curl -O in the background and download the file just as wget would have. This is a quick way to get wget for Mac.

Using Curl As A Wget For Mac Replacement

In order to create an alias of `wget` that will simply run the command curl -O I ran the command below:

echo 'alias wget="curl -O"' >> ~/.bash_profile

Now when i type ‘wget’ it will download the url as you would expect from wget. As mentioned before, in the background it will be invoking curl to download the file. So when I run `wget`, it is actually executing curl -O to download the file as we won’t even notice the difference. Well maybe a small difference. But the end result is the same and your file is downloaded.

Example Using The Replacement wget For Mac


The -O option to curl tells curl to save the URL as a file rather than displaying the source.

And that is all there is to it.

Agree To Xcode License Command Line


With the newer versions of Xcode and iOS being released lately, you will undoubtedly be presented with the updated license agreement. Agreeing to it is mandatory and below I will show you how. So if you are not sure, read on.

Agree To Xcode License Command Line

Performing tasks on the command line in Terminal will cause you to continually be prompted to accept the license agreement like so

12:25pm @ darianbr:  xcodebuild

The prompt looks something like this

Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.
Agree To Xcode License Command Line

Agree To Xcode License Requires Admin Privileges

Accepting the license will require admin privileges. Do so by running the xcodebuild command as sudo. You will be prompted to enter your password and you will be shown the Xcode license agreement.

12:26pm @ darianbr: sudo xcodebuild

You will be prompted to etner your password and will be shown the license agreement.


You have not agreed to the Xcode license agreements. You must agree to both license agreements below in order to use Xcode.

Hit the Enter key to view the license agreements at '/Applications/'

Accepting the Xcode License Agreement

At the end of the license agreement, as show below, you will need to type ‘accept’ (I highlighted in yellow) in order to accept the xcode licence agreement.

5. Services; Mac Developer Program.
A. Apple may provide access to services by or through the Developer Software for you to use.  Use of these services may require an Apple ID, may require you to accept additional terms and may be subject to additional fees. If you elect to use such services in conjunction with the Developer Software, your usage of such services will be subject to those additional terms and conditions (e.g., your use of Developer IDs obtained from your Apple Developer Program account will be subject to the applicable Apple Developer Program terms for Developer IDs), but this License will continue to apply to your use of the Developer Software licensed hereunder. If you would like to submit Applications you develop to the Mac App Store, then you must apply to join the Mac Developer Program. More information about Apple’s Developer Programs is available at Apple reserves the right to refuse admission to any of its 

By typing 'agree' you are agreeing to the terms of the software license agreements. Type 'print' to print them or anything else to cancel, [agree, print, cancel]

Final Words

After typing ‘accept’ and hitting enter, you will now have accepted the license agreement and will no longer be prompted to agree to xcode license agreement.