
Look for the option If no extension is provided, use ".txt" and deselect it.

txt extension to files, open a file in Text edit and choose File > Save As (If you don't see the Save As menu item, hold down the option key after you click File, and Save As should appear in the menu). To turn on displaying filename extensions go to Finder > Preferences > Show all filename extensions So it's kinda obvious, and most people reading this post have probably already done this, but be sure to check that your hosts file is actually there and hasn't been replaced by hosts.txt.
Find hosts file mac os x install#
Normally I would notice something like this, but I am using a fresh install of Yosemite and hadn't yet turned on "show all file extensions" so it didn't look like the file name had changed when I viewed it on my desktop. I used textedit to edit the hosts file, and it took the liberty of saving the file as hosts.txt. The answer was so simple it is embarrassing, actually, but I thought I'd share.

(I rebooted, tried flushing caches, followed every bit of advice I could find on the internet etc etc). I found this article because Yosemite 10.10.5 was not picking up my hosts file changes, and nothing I could do was fixing it. Starting in 10.9, you can also use Network Utility's Lookup tab (before that it used dig, and therefore bypassed the system lookup policy).īTW, please pay no attention to the macrumors thread that Tetsujin linked it's full of people who don't quite know what they're doing and are misunderstanding the results of their own mistakes. but since that's painfully verbose, I tend to just use ping instead (and then look at the first line, where it lists what IP it's pinging). The "official" way to do a lookup through the system resolver in OS X is to use dscacheutil: dscacheutil -q host -a name. They've always done this, so this is not new in Yosemite. However, dig, nslookup, and host will not see entries in it because they bypass the system's resolver and do raw DNS lookups.

Even though the Internet has both public and private DNS servers for mapping of IP address, the hosts file on Mac is a good way to override DNS servers.
Find hosts file mac os x mac os x#
It's not necessary to flush the cache or reset discoveryd (the DNS resolver in Yosemite) sudo fs_usage | grep private/etc/hosts shows discoveryd reading the file immediately after I save changes to it. The Mac hosts file is an important text document on Mac OS X that allows the mapping of hostnames to specified IP address. private/etc/hosts seems to be working normally for me in Yosemite (version 10.10.1).
