Source: iMore
A way to track MAC addresses, that I expect will be more common in the years to follow, is through the IPv6 address of a host. In certain implementations of IPv6 addressing where an IPv6 address is automatically generated for an interface, the MAC address of that interface is embedded in the host part of the IPv6 address.
If you're setting up a new webserver or another device that's going to be connected to the internet and you want to put it through its paces before it's live, or if you're having trouble with spyware and adware networks, there's an invisible file on your Mac that can help. It's called the Hosts file, and this is how to use it.
The Domain Name System
When you type in the domain name of a web site you want to visit there's a lot happening behind the scenes. Every web site, every service, almost every device connected to the Internet has a unique numeric address that tells all the other devices where it is — its TCP/IP address. The Domain Name System (DNS) translates those numeric addresses into something a bit more recognizable and memorable to humans, like, 'www.imore.com' for example.
The first time you type in a web address, your Mac pings a DNS server — typically one automatically configured for you by your Internet Service Provider — to find out the TCP/IP address of the server you're trying to connect to. Your Mac builds up a hidden cache file to remember those details later on when you visit the same site again.
The Hosts file
The Domain Name System and its associated cache is your Mac's standard way of knowing how to get to where it's going on the Internet, but there's another file that can be very useful. It's called the Hosts file, and it can be used to override the default DNS information.
There are some practical reasons why you'd want to use the Hosts file instead of just letting DNS do its thing. Let's say you're testing a development server you're about to deploy, and you'd like to use its domain name instead of the machine's specific IP address. Before the system's online and accessible to anyone using DNS, you can use the Host file instead: Enter the machine's IP address and when you use that domain name, your Mac will go to that device instead.
You can also use the Hosts file to block or work around spyware and ad networks by 'zeroing out' their IP addresses - putting in 0.0.0.0 then the name of the domain you'd like to block.
Unable To Locate Machine Directory For Host Mac Sierra ProHow to edit the Hosts file
You'll need to know the IP address of the device you'd like to send your Mac to, or the domain names you're trying to keep your Mac away from. The best way to work with the Host file is by using the Terminal application found in your Mac's Utilities folder. You can search for Terminal using Spotlight or by selecting it in Finder.
In the Terminal window, you will need to enter a command to open the Nano text editor. You will need your administrator password, as well.
You're now in the Nano text editor. You should see something that looks like this:
If you want to add a new device or domain, move the cursor using the arrow keys and position it after the text in the window. Then, begin typing.
If you're mapping a particular IP address on your local network to a domain, you can type the IP address, hit tab, then type the domain name.
Conversely, if you'd like to make sure a web URL doesn't go to its intended site — if you're trying to keep your Mac away from certain sites, use '127.0.0.1.' That'll map it back to your Mac. Even if your Mac is assigned a different IP address by its router, 127.0.0.1 defaults to the local machine thanks to the default settings in that hose file.
Once you're done, hold down the control and O keys to save the file, then control and X to exit.
One last step
Back at the command line, type sudo killall -HUP mDNSResponder then type return. That will flush your Mac's DNS cache, so it doesn't get confused by any changes you've made to the Hosts file.
Don't forget you've modified the Hosts file, because at some point you may need to undo the changes you've made in order to keep your Mac working right.
How to reset your Mac's Hosts file
When you're ready to undo your changes and restore where your Mac's Hosts file routes to, you can do so by replacing the current host file with a new set of terms. You don't need Terminal for this reset.
Have any questions? Let me know.
Updated February 2020: Updated for macOS Catalina.
macOS CatalinaMain
We may earn a commission for purchases using our links. Learn more.
A more musical home
Apple's new 'Behind the Mac' vid shows James Blake making music at home
Apple's latest 'Behind the Mac' video shows James Blake making music even though he's been stuck in his home studio because of 2020.
Hosts file has an essential role in website configuration & Blocking port. So you can make your own rules about your website hosted on the Local mac running on macOS Mojave, High Sierra, EI Capitan, Yosemite or OS X Server. Point IP address to the desired website URL So you can override DNS temporary by making changes in hosts file located on Mac System. For Edit hosts file on Mac, we need little technical knowledge, and then you can do with ease. However, to edit hosts files follow the below steps carefully.
Note: Before making changes, please take a backup of your host’s files or copy lines of text on to another text file. Here you have two common solutions that might be very useful on Edit hosts file on Mac OS X or OS X Server.
we are happy to help you, submit this Form, if your solution is not covered in this article.
Unable To Locate Machine Directory For Host Mac Sierra DownloadSteps on How to Edit the Hosts File on Macbook, Mac with Latest MacOS
Apple didn’t make any changes on the path of the hosts file location and Command syntax for the older OS X version. Same steps you can try on any OS X version.
I recommend using the Command Line method to open the host file on your Mac. Due to Security Reason, Simple folder method on Your Mac or MacBook Doesn’t Allow to edit hosts file directly like a simple file. You should change on a duplicate Hosts file first. So,
Related Readings
First Easy Way: Command for Open Hosts File on Mac and Edit File Normally
Second Way: Open & Edit Hosts File on Mac Without Terminal Command
You can make changes by shortcut keys give on-screen.
Step 1: Open a Finder Window on your Mac.
Step 2: From Top menu, go to the GO > GO TO FOLDER.
Step 3: Move to Hosts files location type in the text box: /private/etc/hosts and Click on Go.
Step 4: double click on file named hosts, File will be open in the text editor.
Step 5: Inside the hosts file you can edit after broadcasthost.
How to Save Hosts File on Mac Using Keyboard Shortcuts?
Here I redirected twitter account to another website IP for my Mac only. Not work on other Mac. Before Edit file you have to make the new copy of host file, and changes will be saved to a new copy. Then you have to replace that new file with the original file (/private/etc/hosts) manually. Due to privacy reasons, you can’t make changes directly on the original hosts file.
To Exit or Save,
Control + X to Exit and Press Y key to Save in hosts file. and Tap on Return or Enter Button. [Play Below video to Learn on my Mac’s screen]
Unable To Locate Machine Directory For Host Mac Sierra
That’s it. Nothing else. Want more help on Edit hosts to file on macOS Catalina, Mojave, EI Capitan, Yosemite or OS X Server. Share with me on the comment.
Useful: Best Dictation software for Mac
Premium Support is Free Now
We are happy to help you! Follow the next Step if Your Solution is not in this article, Submit this form without Sign Up, We will revert back to you via Personal Mail. In Form, Please Use the Description field to Mention our reference Webpage URL which you visited and Describe your problem in detail if possible. We covered your iPhone 11 Pro, iPhone 11 Pro Max, iPhone 11, iPhone 8(Plus), iPhone 7(Plus), iPhone 6S(Plus), iPhone 6(Plus), iPhone SE, SE 2(2020), iPhone 5S, iPhone 5, iPad All Generation, iPad Pro All Models, MacOS Catalina or Earlier MacOS for iMac, Mac Mini, MacBook Pro, WatchOS 6 & Earlier on Apple Watch 5/4/3/2/1, Apple TV. You can also mention iOS/iPadOS/MacOS. To be Continued...
Jaysukh Patel is the founder of howtoisolve. Also self Professional Developer, Techno lover mainly for iPhone, iPad, iPod Touch and iOS, Jaysukh is one of responsible person in his family.
Contact On: [email protected] [OR] [email protected] Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |