Introduction
The hosts file is a text file that maps hostnames to IP addresses.
Upon typing a url address on the browser, the system is checking if there is a relevant entry on the hosts file and gets the corresponding IP address, else it resolves the IP via the active connection’s DNS servers.
The hosts file can be edited to block certain hostnames (like ad-serving/malicious hosts), or used for web development purposes, i.e. to redirect domains to local addresses.
Editing the hosts file
Editing the hosts file in Mac OS X – Leopard, is a pretty easy task, especially if you are familiar with the terminal.
Step 1 – Open the Terminal.app
Either by start typing Terminal on the Spotlight, or by going into Applications -> Utilities -> Terminal.
Step 2 – Open the hosts file
Open the hosts by typing on the Terminal that you have just opened:
$ sudo nano /private/etc/hosts
Type your user password when prompted.
Step 3 – Edit the hosts file
The hosts file contains some comments (lines starting with the # symbol), as well as some default hostname mappings (e.g. 127.0.0.1 – localhost).
Simply append your new mappings underneath the default ones. Or edit one of the default values if you know what you are doing!
You can navigate the file using the arrow keys.
Step 4 – Save the hosts file
When done editing the hosts file, press control-o to save the file.
Press enter on the filename prompt, and control-x to exit the editor.
Step 5 – Flush the DNS cache
On Leopard you can issue a simple Terminal command to flush the DNS cache, and have your host file changes to take immediate effect:
$ dscacheutil -flushcache
You can now test your new mapping on the browser!
[…] See the original post here: How to edit the hosts file in Mac OS X – Leopard « Decoding the Web […]
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
[ Read 10 lines ]
^G Get Help ^O WriteOut ^R Read File ^Y Prev Page ^K Cut Text ^C Cur Pos
^X Exit ^J Justify ^W Where Is ^V Next Page ^U UnCut Text^T To Spell
i am here what do i do to get into photoshop
Don’t follow Santa’s great commands, doing that will delete all of the files on your root filesystem.
Ben i don’t know what u meant when u asked what do i do to get into photoshop. Open photoshop to go into photoshop i guess?? :S
You gotta press Ctrl+X to exit, then it prompts if you want to save your file or not (Y for yes and N for no) After saving or not saving you are returned back to your shell prompt.
DO NOT FOLLOW SANTA’S COMMANDS! THEY WILL TRY DELETING EVERYTHING ON YOUR ROOT FILESYSTEM!!!!
Does this work on Lion?
Yes, it does.
I lost all of the files on my root filesystem by mistake. my hosts file is empty, blank ;( Please help me!!! I am so desperate!!!!
I am editing host file from terminal window. I entered the password.
When I try to do command+O to save out of editing host file, it prompt me to save that file at a specific location, when I try to navigate it to /private/etc I don’t see that option on my HD at the prompt window.
I am not able to save it. Is there a way to save that existing file I am saving without the prompt?
Maybe my current host file is locked…
Any help?
Its CTRL not CMND!
I cannot make it work. I have an OS X version 10.9.4 – is that my problem?
Thanks, this was a great help!
This doesn’t work on the latest mac OS 10.5.7
Anonymousmonser i know you…
hay its Elodin
@Anon:
What exactly are you trying which doesn’t work? Cause it seems to be working just fine here.
Why does it tell me “permission denied”? I am the only one who uses it and I am the administrator.
Make sure you type “sudo nano /private/etc/hosts”, so that it will prompt you for your administrator password.
I’ve tried is and I get as far as the password bit, but no host file comes up. I don’t have a password, so I just press enter, and it just goes to another command line. 😦
The sudo Terminal command requires a non-blank admin password. Therefore you will have to set a password for your account, edit the hosts file, and then remove it if you wish. Although it is always recommended to have a password set.
If you see a blank file, then you have the path incorrect, or there is no hosts file. Make sure you type it exactly as:
sudo nano -w /etc/hosts
You can list the directory and see if it is in there with:
ls -la /etc
Look for the file named “hosts”, if it is not there, you have other issues, as your machine more or less needs it to work properly. The hosts file is a fundamental to certain code routing aspects of your operating systems network.
Also keep in mind, you can completely stop using /etc/hosts and use dscl to manage your hosts, which seems to be how Apple is moving forward in this regard. `man dscl` for more info.
To add a host with dscl, and skip /etc/hosts the syntax is pretty easy. This would create foobar.local and point it to 127.0.0.1
sudo dscl localhost -create /Local/Default/Hosts/foobar.local IPAddress 127.0.0.1
You can then flush the cache to have it take effect:
sudo dscacheutil -flushcache
And in case you were wondering what is in that cache, just to make sure it was cleared, or if you are having trouble, you can list the cache:
sudo dscacheutil -cachedump -entries Host
You can delete much the same:
sudo dscl localhost -delete /Local/Default/Hosts/foobar.local
And of course, if you want to list your entries:
dscl localhost -list /Local/Default/Hosts
This will not work for this particular application, as the -create modifier requires a *.local only resource locator.
I know this is an old post but for people who are reading today…
On Mac OS X Any version, Always have a password on your account… Admin accounts should Always have one. If you are not an admin on your account, you can make a new one if you own the Mac. If your parents or whoever owns the Mac has set your account up without admin rights, this might be for a reason… It also might mean they didn’t know how to set your account up with admin rights… You should ask the owner or parent to give your account admin rights.
Usually when someone doesn’t have a password for there account, that means they are not an Administrator…. Sometimes it’s for a good reason. Other times, the admin shouldn’t have admin rights… hehe
[…] https://decoding.wordpress.com/2009/04/06/how-to-edit-the-hosts-file-in-mac-os-x-leopard/ http://www.siteground.com/tutorials/php-mysql/mysql_database_user.htm […]
Thanks this was very helpful.
All the answers to this, all over the web, seem a lot harder than they have to be?
Under the GO menu in Finder, select “GOTO Folder”
Type /etc
Find the “hosts” file by name
Double click on it and it will open in text edit.
Edit and Save?
hosts aren’t even stored in a text file on the mac. you have to edit the hosts database, you can export the db entries to a text file and write it back to the db but this method is much easier.
Wrong.
I hate when people are writing stupid things. Get your information straight friend.
That will not work because you will not be able to save, since you do not have permissions to save. You would have to first get info on the file, change the permissions to allow yourself read/write, and then change them back.
I completly agree with Scott and found the solution.
(I think go in the terminal is difficult for most of us)
– Under the GO menu in Finder, select “GOTO Folder”
– Type /etc
– Find the “hosts” file by name
– COPY THE “hosts” FILE IN ANOTHER FOLDER !!!
– EDIT THE NEWS FILE
enter A new ligne as: 80.74.104.231 me.ch http://www.me.ch
– SAVE IT
– PUT THE NEW FILE IN /etc
– you’ll be asked to authentify with your admin password
– it’s finished
(and edit this new file next time will be again forbidden, you will have again to copy it).
For my french friends, this was: “Comment changer le host sur un Mac OS 10.6”
@RBD2
Permissions don’t allow this, at least not by default. Even right-clicking and changing the permissions in the Finder won’t give you access to modify “hosts”. That’s why this post exists.
This was very helpful, glad I found it quickly. Thanks!
Thank you very much for this tip:
Saved my day 🙂
Just switched to Mac
thanks for the tutorial
=)
Thanks for the tutorial!
Entered this in Terminal on a Macbook with OS X 10.5.8 and got the response “-bash: $: command not found”
Do you have any advice for what is wrong?
Thank you!
Please do not paste the $ character! Start from the “sudo …” 🙂
That worked. Thanks!
Great. It had been so long, I’d forgotten how to do this!
Works fine in Snow Leopard 10.6.1.
In case anyone else, like me, is using MAMP, you’ll need to add a virtual host container to your httpd-vhosts.conf or httpd.conf file, matching the new host entry. For example, if I have in my hosts file:
127.0.0.1 site1.com
I’ll need something like this in my apache httpd-vhosts.conf:
DocumentRoot “/Users/username/Sites/site1/www”
ServerName site1.com
ServerAlias site1.com *.site1.com
Is it possible for someone to upload a file with the actual content before and after editing? Here’s what I see in terminal after entering the sudo nano etc. line
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
Where do I go from here?
From nano you can directly type text, or copy/paste, and save it at the end via control-o.
In a discussion about excluding Omniture via hosts file the following were listed as probable suspects:
127.0.0.1 omnituretrack.local.com
127.0.0.1 analytic.spamfighter.com #[Omniture]
127.0.0.1 cdn11.sphere.com #[Omniture]
127.0.0.1 http://www.sphere.com #[SphereOmniture]
127.0.0.1 omniture.secure.miisolutions.net
127.0.0.1 html.knbc.com #[Omniture]
127.0.0.1 html.nbc10.com #[Omniture]
127.0.0.1 html.wnbc.com #[Omniture]
# [Omniture][Wildcard DNS]
127.0.0.1 omniture.112.2o7.net #[McAfee.Cookie-Omniture]
127.0.0.1 omniturecom.112.2o7.net
127.0.0.1 omniturebanners.112.2o7.net
127.0.0.1 stats.esomniture.com #[SpySweeper.Spy.Cookie]
127.0.0.1 http://www.omniture.com
# [Omniture via Misc Sites]
127.0.0.1 omniture.chip.de
# [Omniture via Offermatica]
# [Omniture via WebSideStory]
………………………………………………………………….
Can the above simply be pasted, *as is*, into the hosts file?
In particular, the “#” and [brackets] – is this acceptable syntax?
Yeap, it can be pasted.
The lines starting with # are comments, they are ignored by the system.
works fine , thanks
Text Wrangler (free) from Bare Bones Software will edit the /etc/hosts file with admin privileges no sweat. Use the “Open File by Name” under the File menu.
Also it’s advised to use “0.0.0.0”(nothing) instead of “127.0.0.1” (your computer) when blocking your computer from a website. Using “127.0.0.1” has caused issues of listens on TCP ports from hostile sites due to a OS X bug. (Leopard, I don’t know yet about Snow Leopard)
Also if you want the best host blocking list on the internet look here for the link.
http://www.mvps.org/winhelp2002/hosts.htm
Here’s the list, it’s updated every few weeks or so.
http://www.mvps.org/winhelp2002/hosts.txt
So for OS X, one has to replace all the “127.0.0.1”‘s to “0.0.0.0”‘s in list. (NOT “127.0.0.1 local host” leave this as is)
After copying the list and “Find and Replace” the “127.0.01”‘s to “0.0.0.0”‘s, then paste to the bottom of the file: /etc/hosts. Save it with your admin password. You might have to reboot.
Works great, especially for those annoying Vibrant Media “intellitext” ads that popup with a mouse over.
Replace the addition every two weeks or so with the updated version from the same site.
I’ve been surfing a much happier person. 🙂
Can anybody help me to edit the terminal commands…
I wanna know how to enter my pass word here…
After this command it prompt me to type the admin password
but I can`t type the password there is no cursor point…
So if I have to type as command please tell me…
sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit /etc/hosts
Thanks in advance
Ciril
Simply go ahead and type your password, it is not shown for security reasons, typing works!
[…] (or even completely swap out) the hosts file on Mac OS X Leopard. While it is possible to do this through the terminal, there is a great little tool from Clockwise that fits the bill just right called Gas […]
Thank you! Thank you! Thank you! Got it to work straight away.
The terminal makes me nervous – is there a slick GUI application that can manage changes like this – perhaps one where I could toggle the changes on and off?
I do not think you will find a GUI for editing this. In the end, it is just a text file. You may want to look at a basic text editor, something like TextMate, which is paid for, or TextWranger, which is free. Both will allow you to edit any file, and if your permissions are not high enough, it will prompt you for your admin password, and then save the file.
The hosts file is nothing more than a spreadsheet with two columns, and as many rows as you want. Column 1 is the IP address, column 2 is the hostname.
You can use a space or a tab to delineate the columns.
Many years ago, before DNS was invented, before BIND/named was even a thought, there was a large hosts file people would share in order to manage getting to the hosts they wanted to. Eventually, this fell apart, which leaves us where we are today, with DNS servers.
The hosts file is a bare bones DNS server. One thing it does not support which would be nice, is wildcards, so you can not do something like:
127.0.0.1 *.example.com
and have it resolve foo.example.com, bar.example.com and others. You have to enter in each host, which for some development of certain sites, is going to mean you end up needing to enable named to get your development site to work.
Hi
I want to be able to install and access a local development website.
so i modified the file accordingly
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
1.2.3.4 http://www.mywebsite.com
127.0.0.1 mywebsite.com
I want to remove
1.2.3.4 http://www.mywebsite.com
127.0.0.1 mywebsite.com
press ^S
press ^X
and it shows
XOFF ignored, mumble mumble
can you explain why?
and more than anything remove
1.2.3.4 http://www.mywebsite.com
127.0.0.1 mywebsite.com
many thanks
Just use the arrow keys to navigate to the line you want to delete, and use the delete key. You can also put a # in front of the mapping/line, and it will be ignored.
The mumble mumble message is produced because you’re using ^s to save the changes, where you should be using ^o.
🙂
Thanks a lot! It works
Hi, i am working on editing the host file of my boss’ mac os x 10.5.8.. we followed the typing of the hosts file in the terminal app and it required password.. however, cursor not moving.. he keeps on typing but cursor not moving.. sorry not familiar with mac.. so hopefully you can help me..
thanks!
As I said in a couple of comments above “Simply go ahead and type your password, it is not shown for security reasons, typing works!”. Press enter when you finish typing your password.
excelllent, works in 5 mins, thankyou
Since you seem so keen to reply to folks (great!), perhaps you can help me out too. I have the same problem that Jere Krischel has in this thread:
http://discussions.apple.com/message.jspa?messageID=10430365#10430365
Which is namely that this works:
0.0.0.0 http://www.google.com
But this doesn’t:
2001:4860:a003::68 http://www.google.com
Nor this:
2001:4860:a003::68%gif0 http://www.google.com
Any ideas? I have tried all the other hostnames returned by an nslookup too (e.g. www-tmmdi.l.google.com).
My goal is to redirect Safari’s search box to use ipv6.google.com by changing the address that http://www.google.com resolves to.
BTW, IPv6 connectivity is fine and ipv6.google.com works in Safari using generic interface (gif) tunnelling:
# dig -6 -x 2001:4860:a003::68
; <> DiG 9.6.0-APPLE-P2 <> -6 -x 2001:4860:a003::68
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 2734
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 12, ADDITIONAL: 10
;; ANSWER SECTION:
8.6.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.3.0.0.a.0.6.8.4.1.0.0.2.ip6.arpa. 86383IN PTR fx-in-x68.1e100.net.
Got all excited when I saw this, but I just keep running into snags on my journey to edit the host file.
In the terminal, I type “sudo nano /private/etc/hosts” as instructed, but instead of getting the password request, I get:
sudo: /etc/sudoers is mode 0664, should be 0440
Segmentation fault
Being somewhat (who am I kidding? totally and helplessly) new to Mac, I am at a complete loss.
Halp?
You have a permissions error with your sudoers file, which is an instruction file for who is allowed to use the sudo command.
This is a hard one to solve, as you need sudo to fix the problem, but you are not allowed to. Are you sure you are in an admin account?
If not, you may have to start in single user mode, reboot holding the “S” key, be careful, you are logged into the machine as root. It will be a black screen, white type, a really large terminal basically.
Enter in:
/bin/chmod 0440 /etc/sudoers
I can not remember, but you may have to mount your volume first, there are instruction on the screen for doing so.
Type “reboot” when you are done, and you should no longer see the error you see.
Ah… Never mind. Figured it out.
For those of you who googled yourself here with the same issue like me, I fixed the sudoers mode thing with the Disk Utility. Highlight your startup volume and click “repair disk permissions”. Should take a couple minutes, but it fixes all the things you screwed up while trying to edit the host file.
Thanks for the feedback and the solution! It’s gonna be useful for other readers as well.
Just so you know, even 2 years on that little step helps me immensely!
Thanks for the article. It worked perfectly and saved me a bunch of time.
how do i append my new mappings under default ones? what are new mappings?
I have a really crazy problem! I just hot the newest MacBook Pro with Mac OS X 10.6.2 (the latest one). I do everything right and I can locate the “hosts” file in “/private/etc/hosts.” It is there, but its jut that the actual “hosts” file is an alias and when i click it to open it something says “orignal hosts file cannot be found” therefore the “hosts” cannot be opened. I even called Apple Customer Support and they wont help me open the “hosts” because its against the Term of Agreements. THey just tell me its suppose to be like that and it locked. But I googled and searched for anyone who has the same problem but I cant find anything.
Basically my main question is:
How do I open/ unlock my “hosts” file? Which is and alias, and when I try to open, it says “original hosts file cannot be found”
PLEASE ANYONE HELP!
I need the “hosts” file so I can edit it and get adobe for free
Huh. Running 10.6.2. Opened hosts file via Finder Menu Go->Go to File->/etc.
Edited hosts file, saved and it told me simply “The document “hosts” could not be saved.”
Anyone else seen this?
Got it…
It’s in the Private folder, so you have to copy to user folder (desktop for example), edit, save and then move back to /etc. Authenticate with your user password to replace.
Uhm, no, this is not correct.
For those of you that are thinking there is a difference in the file located at:
/etc/hosts
and the one located at:
/private/etc/hosts
There is no difference, they are the same file.
As you can see, /etc is a link to /private/etc
You do not need to use /private/etc/hosts
Just use sudo pico -w /etc/hosts or sudo nano -e /etc/hosts
The -w tells it not to wrap, which can cause problems with line truncation. Even pico and nano are the same case, two seemingly different text editors, but one is just a link to the other. If you list the files in /usr/bin you can see that pico is:
lrwxr-xr-x 1 root wheel 4 Jan 2 18:55 pico -> nano
Which is a link, much like a Finder Alias, though not quite the same.
Thanks CB, but when i copy it onto desktop its still an alias and it does the same exact thing as before when I click it
Doost:
How are you copying it to the desktop? I tried copy/paste, drang and drop, command + drag and drop and alt + drag and drop and it created a new file every time.
You may have to select the file, command + I for get info, then at the bottom of that info window change the Sharing and Permissions settings all to “read and write”. Then copy to desk.
Once you copy it back to /etc you can change the “Staff” and “Everyone” settings back to read only. Notice, where the highest of the three settings used to be called “System” it is now called by your user name.
Hope that helps.
I am moving a site to a new server (server 1) and testing it while the original site (server 2) is still live. My host file does get read and sends me to server 1, but only for about 2 minutes, after that it resolves to server 2. If I clear the browser cache and the DNS cache (dscacheutil -flushcache in Terminal), I can get back to server 1, again for about 2 minutes. (I would just give the site on server 1 a different url, but am working with a CMS that requires a domain name.) Anybody know why this is happening, or suggestions for a fix? It’s a pain!
I’m having this exact same problem, except I can’t even access my test site. I’ve used traceroute to confirm the url is pointing to the desired IP, but still keep going to the live site.
Any help would be much appreciated!
Traceroute will lean on the real DNS bound website over the /etc/hosts file. So if you have amazon.com in your hosts file, do not expect traceroute to honor the hosts file. There may be a way to over ride that behavior with a flag to traceroute. If you are on windows, traceroute is sort of broken regardless.
Thanks Scott. Seems like I have an issue with our proxy or something else on our network. Funny I can’t reply to your message.
thank you very much !
When I do the sudo nano thing then enter the code I want. When I go to save it says the file is non-existent.
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
74.208.10.249 gs.apple.com
This is what i have now on my hosts file but i still cannot contact the cydia server. itunes keep saying (The iPhone could not br restore. This device isn’t eligible for requested build.) i have now tried 3 macs and followed every step but no luck. Any help would be great.
I do not get it either:
Consider this test below: (Note, I have never found I needed to flushcache, though I have tried it to no help in this case)
Added these three entries
74.208.10.249 gs.apple.com
74.208.10.249 example.com
74.208.10.249 example.apple.com
In terminal.app, you can run the lookups
$curl gs.apple.com
$curl example.com
$curl example.apple.com
The first one, returns results that are an Apple server, the second two return the results of the Cydia server. You can test it in a browser as well:
http://74.208.10.249/
As you can see, that is the rendered version of the above curl commands. You are getting the Cydia page in your browser.
http://example.com/
Same thing as above, you get the Cydia server page
http://example.apple.com/
And this shows that we can in fact control domains that are within the apple.com TLD (Top Level Domain).
http://gs.apple.com/
This appears to be an Apple server, or at the very least, not the Cydia server you are after. It is hitting a server at 17.112.176.11, anything that starts with 17. is Apple, they are allocated the entire 17.0.0.0/8
Another good tool in this is just a simple ping of the new hostname, as it will show you the IP it is connecting to, and seems to consult the hosts file, whereas tools like dig do not, and curl is just doing what the browser does, and does not show you what happens behind the scenes.
*This is obviously getting under my skin…
Adding this to the hosts file
127.0.0.1 gs.apple.com
$ping gs.apple.com
64 bytes from 127.0.0.1: icmp_seq=27 ttl=64 time=0.042 ms
Ok, so that worked, it allowed me to change the IP it resolves to.
Added back into the hosts file:
74.208.10.249 gs.apple.com
$ping gs.apple.com
PING gs.apple.com (74.208.10.249): 56 data bytes
In that case, gs.apple.com is going to the Cydia server, but an http request via curl or a browser, and I do not get the correct site.
Traceroute ends up at the correct location as well.
If you enter in the data into /etc/hosts and do a
$ping gs.apple.com
in the terminal, and it returns a ping result with the address of 74.208.10.249, then you have edited the hosts file correctly. There is something deeper going on here, like certain apps consulting the hosts file, but ignoring alterations to it for specific hosts.
I really do not believe Apple would break the functionality of the hosts file even for just one specific host, so there is simply something that is not understood entirely here.
[…] Source & Credit go to: https://decoding.wordpress.com […]
[…] Try these 2 links, they helped me Caching Apple's Signature Server – Jay Freeman (saurik) How to edit the hosts file in Mac OS X – Leopard Decoding the Web with that you will be able to restore thru itunes to a 3.0 or 3.1 > whichever you have on file. […]
In my case I also had to remove web-proxy from Network configuration.
In case web-proxy was present the DNS would not resolve to what was in the /etc/hosts file.
Mac OS X Snow Leopard (can’t lookup the exact version now)
It works but I still can’t access my local web server by going to localhost.
I have switched on web sharing and using the IP address from the web sharing dialog box doesn’t work either.
I did this just so I could block some sites – but it doesn’t work. I saved, cleared my cache, tried it through terminal itself and through opening it through TextEdit but the sites still come up in my browser. Help?
Thanks.
I open the terminal, edit the hosts but when I press command-X it doesn’t save or do anything.I see the shortcuts at the bottom of the terminal window.I see that I need to press command-X but it doesn’t work.
How can I save the edited hosts file?
Please read carefully step 4, control-o, control-x, not command.
Thank you again, now it works. I am a pc to mac switcher and still confused with that command-ctrl buttons 🙂
Thanks at lot for the hint buddy!
You are a king! Thank you so much.
Forced 3.1.3 update backed out to 3.1.2 and fully restored after a blackrain hack of the os – YES!!!
Hi there, I references this article over at ireallyneedinfo.wordpress.com hope you don’t mind.
Regards
Simon
[…] The solution is to make iTunes think it is talking to Apple when it is not. Saurik, the granddaddy of jailbreaking has an excellent guide to this HERE. I won’t explain the process in detail as he does an excellent job. Less tech inclined Mac users take note, if you are having trouble finding your host file fear not! I have found a nifty guide for editing it HERE. […]
Hi, I use the 10.6.3 version and cant get it work. help ?
Starting from the typical initial example of
Line 1: 127.0.0.1 localhost
Line 2: 255.255.255.255 broadcasthost
Line 3: ::1 localhost
Line 4: fe80::1%lo0 localhost
where should new entries be located? I’ve heard everything from “it doesn’t matter, they can even go after line 4” to specific pairs. What’s your take on this?
Yes, just start from the next blank line.
[…] […]
It did not work 😦 I am so disappointed
dhawan: “What” did not work? If you’re talking about using the next blank line, it worked for me on some ping tests. I don’t know if it was required but I did reboot after making the edit.
[…] The solution is to make iTunes think it is talking to Apple when it is not. Saurik, the granddaddy of jailbreaking has an excellent guide to this HERE. I won’t explain the process in detail as he does an excellent job. Less tech inclined Mac users take note, if you are having trouble finding your host file fear not! I have found a nifty guide for editing it HERE. […]
Great article but Scott’s comment certainly was the winner.
I had a mapping which wasnt in the host file and needed to perform
sudo dscl localhost -delete /Local/Default/Hosts
in order to remove it. I have found it existed with this command
dscl localhost -list /Local/Default/Hosts
hello, i have a problem whit the terminal, first i have a new macbook and i wanted to install de Adobe illustrator on it, the program was downloaded of a internet page, the instructions of how to install mentioned it somenthig of the terminal
(1)Select trial serial and install
(2)Quit CS5 if it opens after launch
(3)Edit your Host’s file to block “home calls” in CS5:
Open a “Terminal” and type:
Code:
sudo nano /private/etc/hosts
Copy & Paste this lines:
Code:
127.0.0.1 activate.adobe.com
127.0.0.1 practivate.adobe.com
127.0.0.1 ereg.adobe.com
127.0.0.1 activate.wip3.adobe.com
127.0.0.1 wip3.adobe.com
127.0.0.1 3dns-3.adobe.com
127.0.0.1 3dns-2.adobe.com
127.0.0.1 adobe-dns.adobe.com
127.0.0.1 adobe-dns-2.adobe.com
127.0.0.1 adobe-dns-3.adobe.com
127.0.0.1 ereg.wip3.adobe.com
127.0.0.1 activate-sea.adobe.com
127.0.0.1 wwis-dubc1-vip60.adobe.com
127.0.0.1 activate-sjc0.adobe.com
127.0.0.1 adobe.activate.com
127.0.0.1 hl2rcv.adobe.com
127.0.0.1 209.34.83.73:443
127.0.0.1 209.34.83.73:43
127.0.0.1 209.34.83.73
127.0.0.1 209.34.83.67:443
127.0.0.1 209.34.83.67:43
127.0.0.1 209.34.83.67
127.0.0.1 ood.opsource.net
127.0.0.1 CRL.VERISIGN.NET
127.0.0.1 199.7.52.190:80
127.0.0.1 199.7.52.190
127.0.0.1 adobeereg.com
127.0.0.1 OCSP.SPO1.VERISIGN.COM
127.0.0.1 199.7.54.72:80
127.0.0.1 199.7.54.72
Save with:
Code:
CONTROL + X
An then type this to flush the DNS cache, and have your host file changes to take immediate effect:
Code:
dscacheutil -flushcache
(4)Open CS5 and click on the help menu and select “Deactivate°≠”
(5) Select “Deactivate Permanently” then done. Quit CS5
(6) Reopen CS5 and enter the serial
im trying to install it, but when i was put the sudo and inserts the password something appeard a window saying to me that i didn’t understand very well and later on the terminal nothing appeard, when you open the terminal something like this appears:
Last login: Sun Jun 6 14:37:02 on ttys000
macbook:~ wisbooh$
right?
well when i i put the sudo and the other codes, and aceppt the extrage window..all erase it of the terminal and when close the terminal and open again nothing appears (last login and bla,bla,bla)
something will have erased?
i didn’t know what i did…
because i don’t speak english well so if you can understand me i need your help, if you can anwser in spanish
I added these to the file did the flush. I have the trial and I am getting invalid SN. Any suggestions?
Yes, I suggest buying a legal copy of CS 5 and not violating international copyright laws and end user license agreements.
Hi, I said what you didn’t, but I cannot save the host file, it says “you don’t have permission to change this file”, I remember doing something to change the permission, but cannot figure out how, can you helo me please?
“Code:
dscacheutil -flushcache
(4)Open CS5 and click on the help menu and select “Deactivate°≠”
(5) Select “Deactivate Permanently” then done. Quit CS5
(6) Reopen CS5 and enter the serial”
well, there was no help menu in the cs5 install manager to deactivate “homecalling”. so i typed in my serial before i actually deactivated it.
but now, everytime I start illustrator it asks me for my serial before I can start working.
Thanks for the guide, very useful.
hi I did this while wanting to install an app but now i don’t need it so have deleted the app… please can you teach me how to reverse this? When I open terminal it doesn’t come up with my usual computer name, it’s just blank.
[…] servers. This is where we take advantage of those SHSH blobs you stored with Cydia. I used this guide at Decoding the Web to help me find and edit the hosts file so that I could add this line to the […]
Excellent! Thanks for this.
Joe,
Nothing in this article does anything that needs to be undone. The instructions here simply open the hosts file to allow you to make and save entries, then flush the DNS so that the system reads the new changes. They only changes that were made were whatever entries you made in the Hosts file. Whatever problem you are having with the terminal is unrelated to this article or changes made to the Hosts file. No changes were made to the terminal itself. The Hosts file is really just a text file. All you do is access the Hosts file and delete the entry you created.
Also, it’s not a big deal to leave the entry in the hosts file until you get your problem straightened out. It’s not hurting anything, and will only be a factor if you need it to legitimately connect to that server for that software.
Twinmemo,
Last login: Sun Jun 6 14:37:02 on ttys000
macbook:~ wisbooh$
Is exactly what you should be seeing when you open the terminal. Now just enter the sudo nano /private/etc/hosts as mentioned. Make your entry changes and save the file. Try using the control-o and enter to save before the control-x to exit . You may have said “no” to saving the changes.
Really useful, tnx a lot 🙂
[…] MAC – /private/etc/hosts sīkāk kā rediģēt uz Leoparda vai Snow Leoparda aprakstīts šeit […]
[…] (numbered items link) […]
[…] with Saurik’s server. Follow this link to show you have to edit your host file for mac How to edit the hosts file in Mac OS X – Leopard Decoding the Web […]
Hi there, i did the as the instructions says & keyed in $ sudo nano /private/etc/hosts just to check if changes were saved and got this response:
Last login: Wed Aug 11 09:20:58 on console
Meier-Charles-Razis-MacBook-Pro:~ Charlyboy$ $ sudo nano /private/etc/hosts
-bash: $: command not found
Is this ok?
Thanks,
Charles Meier (Mac Newbie)
& got this when i tried to ping iesnare:
Meier-Charles-Razis-MacBook-Pro:~ Charlyboy$ ping iesnare.com
PING iesnare.com (74.121.28.139): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3
Request timeout for icmp_seq 4
Request timeout for icmp_seq 5
Request timeout for icmp_seq 6
Request timeout for icmp_seq 7
Request timeout for icmp_seq 8
Request timeout for icmp_seq 9
Request timeout for icmp_seq 10
Hello Charly, as I said before don’t include the $ symbol in the command, start from sudo…
Due to the google pagerank of this article, and after some exhaustive research: I presume the issue here is that Safari passes all URL lookups to the mDNSresponder daemon that you’ve always seen running without really understanding why.
If you ‘sudo kill’ the mDNSr process, it will immediately re-appear, and those of you whom use Little Snitch will note its constant annoyance of this mDNSresponder service. Yes, this is the same process that 10.5.7- was only used to broadcast the Bonjour/Rendezvous service . Now, not only does this service announce, it handle’s Safari’s built in URL DNS requests. Darn.
So, my work-around, as an on-again-off-again ITer would be to use Hao Li’s Saft plugin with your Safari distributions – HL is very easy to get along with and will work something out with your corp. This way, you can neuter the integrated beast that Safari has become [think of how horribly IE is fleshed with Windows].
Apple has become the beast. Never did I think Apple would be commodered with satanic, turtleneck-abusing misanity. Mr. Big Money Bags, what have you done with your company?
i tried to install but it can’t. sudo nano /private/etc/hosts then “To proceed, enter your password, or type Ctrl-C to abort.” what pass do i use?
Rean.. i use the password for my mac os x user account. My account is also an administrator account.
check here for password details.
http://support.apple.com/kb/ht1274
This is kinda the namby-pamby way of modifying the hosts file, but for me it actually works very well so maybe others can make use of it. And everything you need to do it with is all standard on OS X.
The time it takes you to do this will probably be less than poking around the text editors in Terminal.
No third party apps. No navigating through pico (urg). You will need Terminal to issue to simply commands, but that’s it.
You will also need administrator rights.
In Finder, under the Go Menu, choose Go To Folder, and type:
/etc
Scroll down a bit and you’ll find the Hosts file
Control click on the file and do an “Open With” and choose TextEdit. If you’re new to doing stuff like this, back ups are your friend in case something goes array so do a “save as” somewhere in your home folder (this eliminates the privileges issue, for the moment), ensuring encoding for the file is plain text and UTF-8 (TextEdit defaults to MacRoman so you have to watch that). Actually do that twice – so you have two identical copies of Hosts – called the second Hosts.bak.
Now open the other Hosts file you just created and make your changes and save.
Launch Terminal and type the follow:
/usr/bin/sudo mv
followed by one press of the space bar
and then drag your newly created Hosts file onto the Terminal (this is just a shortcut to populate its path)
followed by one more press of the space bar
followed by
/etc
then press return.
This will move the new hosts file, overwriting the old one in the process.
Now you need to assign the appropriate ownership to the file, which should be owner=root (ie: system in Finder) and the group should=wheel.
Back to Terminal type
/usr/bin/sudo chown root:wheel /etc/hosts
and press return.
Flush your cache as directed above and you’re ready to go.
😉
You are awesome. Thanks!
[…] Posted by james the 2nd Host files? Where abouts are they and what am I looking for? Thanks How to edit the hosts file in Mac OS X – Leopard Decoding the Web also, if you open a command terminal and type 'ping 9 to 5 Mac | Apple Intelligence' what IP […]
i got it there but it wont let me add anything to it
can someone help me ive accidently modified the hosts file and cannot get it back to normal therefore my iphone wont restore.
can someone just copy and paste there 4.0.2 hosts so i can use it plz
Awesome. Thanks for the tip!
[…] […]
@decoding
Hello!
I got some problem trying downgrade my iPad.
“The iPad “iPad” could not be restored. This device isn’t elegible for the requested build.
Could you help me to fix that?
Thx
My hosts looks like above
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
#as 4 linhas abaixo foi editada com # para nao ser lido
#127.0.0.1 localhost
#255.255.255.255 broadcasthost
#::1 localhost
#fe80::1%lo0 localhost
127.0.0.1 activate.adobe.com
127.0.0.1 practivate.adobe.com
127.0.0.1 ereg.adobe.com
127.0.0.1 activate.wip3.adobe.com
127.0.0.1 wip3.adobe.com
127.0.0.1 3dns-3.adobe.com
127.0.0.1 3dns-2.adobe.com
127.0.0.1 adobe-dns.adobe.com
127.0.0.1 adobe-dns-2.adobe.com
127.0.0.1 adobe-dns-3.adobe.com
127.0.0.1 ereg.wip3.adobe.com
127.0.0.1 activate-sea.adobe.com
127.0.0.1 wwis-dubc1-vip60.adobe.com
127.0.0.1 activate-sjc0.adobe.com
74.208.105.171 gs.apple.com
[…] How to edit the hosts file in Mac OS X – Leopard « Decoding the Web. […]
Anyone ever had an issue where the terminal just dies after you get the promp, To proceed, enter your password, or type Ctrl-C to abort.
I am completely unable to enter anyting exept enter and the prompt Ctrl+C..?
What do I do?
Just type your password, and press ENTER, it ain’t dead at the moment, it simply hides your typed characters.
Thanks that helped alot! 😉
I’ve saved the code (for dreamweaver) with Control-O, Enter, and Control-X in the Terminal
Now it says:
An then type this to flush the DNS cache, and have your host file changes to take immediate effect:
Code:
dscacheutil -flushcache
Where? Still in the Terminal?
And after doing this, i just have to close it? Or what?
(fyi: i don’t have snow leopard, just mac os… and i don’t speek english well ;-))
Yes, run the flush command on the Terminal, and you are done with it!
Thanks, this was a great help. (and works just fine on my Mac OSX version 10.6.4)
[…] view sourceprint? 1 $ dscacheutil -flushcache You can now test your new mapping on the browser! SOURCE […]
excellent and concise article. Has already looked at a couple of tutorials prior to yours but found them to be over complicated and full of mistakes/omissions which made them difficult to follow.
So I did not trust them enough to risk killing my machine over.
Have now book marked your blog for future reference.
Regards,
Rob
[…] How to edit the hosts file in Mac OS X – Leopard Decoding the Web You may skip the last step. (Step 5) […]
[…] How to edit the hosts file in Mac OS X – Leopard Decoding the Web has an explanation on how to edit your hosts file. Basically you can point any website you like to another location. So if you add a line Code: […]
Getting my hands bloody on mac os x 🙂
Gote chrome, skype, sql seveloper, java, etc. running – kudos, apples 🙂
thanx its working
I came to this discussion looking for a way to make a persistent
alias declaration in 10.5.8, so this may be related. I could
make an alias declaration in .bash_alias and source it but
it wasn’t operative after a reboot. I simply put the alias in
the three permissible files it is allowed in. In my home directory
I created (touch) .bash_alias, .bash_profile and .bashrc and copied (cp) from .bash_alias to .bash_profile and .bashrc. The dotfiles
have identical content. Now leopard can remember aliases between boots.
Surely some unix tradition has been abandoned for this strange
behavior with /etc/hosts and .bashxxx. I’m here because
microsoft broke my mirrors and I’m using a borrowed mac for the first time. It seems to me that really big players are ok with
creating their own conventions; all right but publish them and
respect our time.
In MacOS X Leopard only the original tip works. The sudo open -t will not work. This will launch the TextEdit and open the file, but when one tries to save it TextEdit will complaint that it does not have enough privileges to save the file.
Thanks. Top tip on editing the hosts file. Hopefully saving me a new iphone !
[…] Dal jsem tomu pěknou ikonku a umístil do Docku. Jinak jsem kontroloval IP Googlu a mám zjištěné IP, kdy to funguje. Tak to možná nastavím natvrdo. […]
How do you un-Patch the host files for cs5? I installed a try before you buy version of CS5 from a torrent site and now i have enough cash to buy it. I had a CS4 master collection on there previously and when i try and deactivate it just says it wont connect to the internet and i think its because when i patched the host files for the cs5 install, it has blocked the connection to adobe!
You thoughts or methods to rectify this problem would be much apreciated.
Hi Paddy,
Go back into your hosts file and remove the adobe-related items (maybe back it up first). You might also wanna search for Adobe’s CS4 clean script.
[…] Here’s a good instruction for Macs. […]
i had done all the steps as above for my adobe cs5 creative suite , but after i done the dscacheutil -flushcache, and i reopen the illus ,no help menu in the cs5 install manager to deactivate “homecalling”. so i typed in my serial before i actually deactivated it.
but after the serail , the deactivated button still unable to click , n then what should i do now?? will i save using it now ??im new to mac , so dont know much about mac…
i had done all the steps as above for my adobe cs5 creative suite , but after i done the dscacheutil -flushcache, and i reopen the illus ,no help menu in the cs5 install manager to deactivate “homecalling”. so i typed in my serial before i actually deactivated it.
but after the serail , the deactivated button still unable to click , n then what should i do now?? will i save using it now ??im new to mac , so dont know much about mac…
really need hepls to told me what should i do , or tech me step by step .. thx alot ….
[ Error writing /private/etc/hosts: Permission denied ]
This is what i get when i try to save it.
Hi,
After I type in sudo…., and I’m promoted to give my Admin password I can not type in the password.
It simply won’t type. do you know why?
thanks
it doesnt show up when you type it but its still registering it jus type it in and hit enter and it will work
Had to try this 3 times due to “user error” as I was getting the “permission denied” as well. But when followed completely the 3rd time, everything worked as you said it would. Thanks!
when i type in the sudo nano thing it says im not in the sudoers file. what does that mean and how can i fix it?
i’m mac osx 10.5.8 ,i want to use terminal to install something,and it say type password, i type any word with keyboard but it not do anything ,i hit enter but it say try again,it wouldn’t let me type my password. how to solve this problem ? can you help me ?thx
[…] you need more information on how to edit your hosts file, look here (Windows) or here […]
[…] for my DNS host to cron update my domains zone file. So what to do? You guessed right. I can do an oldschool hosts file hack. But wait, I already tried looking up the domain – and the earlier resolved IP is still in my […]
When trying to edit the hosts file i get to the stage of the host file box and it has all the writing that above forums says it should..first line is hash hash and then all the other line up until this one : :1 local host.
The problem is i can’t type anything in this box before of after this info. Does anyone know how I can solve this!? The keyboard just doesn’t even register in this box. WOuld be so grateful for any advice.
thankyou soo much…!!
It is crystal clear and easy to perform the steps.
thanks again……..
[…] 1013. tiny umbrella wont kick the phone out of recovery. assuming your on mac this might help How to edit the hosts file in Mac OS X – Leopard if on windows 7 look in C:WindowsSystem32driversetc you will need to use notepad in […]
man! a big thanks for you!
that was soo helpful.
God bless you!
hey all 🙂
Edited the hosts file without a hitch. But the program I am trying to use seems to be ignoring the host file. Is there a second or third alias file I should be editing as well? I’m trying to get a web based program to work, and the only workaround is to have their hostname as a trusted host.. thanx for any and all advice!
[…] can now test your new mapping on the browser! bron: https://decoding.wordpress.com/2009/04/06/how-to-edit-the-hosts-file-in-mac-os-x-leopard/ This entry was posted in Tips en Trucks. Bookmark the permalink. ← Training 15 januari […]
[…] Open the hosts by typing on the Terminal that you have just opened: view sourceprint? […]
[…] step was to configure my Mac so I could get to the servers. Following the instructions found at How to Edit Hosts Files – OSX and with the information given to me by our ICT administrator I was able to make the connection to […]
Thanks, it work.
[…] For Mac if you have permissions problems you can edit via terminal using this tutorial […]
i edited this file and now i want the defaul stuff back what is it 😦
i have
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
but i think its suppost to be
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
It helped me. Thanks .
Great,works fine!
[…] For Mac if you have permissions problems you can edit via terminal using this tutorial […]
I’m trying to create a local domain name, a local email address and the same for the server. I am using xamp as my server package. I have instructions telling me to change these lines:
127.0.0.1 http://www.example.com # For browser access
127.0.0.1 mail.example.com # For email access
127.0.0.1 example.com # For mercury mail server
Yet what I get in the terminal are these lines:
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
Is there anyone that can make sense of this for me?
Thank you kindly!
Thanks a bunch! Very helpful!
if you don’t like using terminal then text wrangler is a great way of editing the hosts file
to see the hosts file where it is, you need to use something like tinker tool to show hidden and system files, go to your root and follow up private/etc/ and open it e.g. by drag and drop, text wrangler will ask you for your password…
like in windows, when you see everything you can easily damage things,
…so be careful ; )
[…] Introduction The hosts file is a text file that maps hostnames to IP addresses. Upon typing a url address on the browser, the system is checking if there is a relevant entry on the hosts file and gets the corresponding IP address, else it resolves the IP via the active connection's DNS servers. The hosts file can be edited to block certain hostnames (like ad-serving/malicious hosts), or used for web development purposes, i.e. to redirect domains … Read More […]
[…] Works for Snow Leopard too! Click here for the original source. […]
Hello
its my host file
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
127.0.0.1 obdev.at
what can i do now ? my itunes could not be connected to internet !!!!!!
please help me
great help
I’m trying to install photoshop cs5
i’ve followed the instruction. when photoshop opens only the top section appears.
Instruction say to go to help menu and deactivate. but the deactivate line is gray and not clickable.
PLEASE help!
🙂
Old article, but exactly what I was looking for.
[…] found in the Apple Support Communities, worked for me. Edit your hosts file. Instructions: How to edit the hosts file in Mac OS X – Leopard Decoding the Web Remove the line containing: "xxx.xxx.xxx.xxx gs.apple.com" Then try the update again. […]
[…] How to edit the hosts file in Mac OS X – Leopard […]
[…] host file part, which you don't even have to do. (If you insist, the host file can be found using this link) You should be able to follow the router section and config section verbatim. […]
okay people i am new here and please reply fast! Im having trouble with this
Blocking “home calls” in the host. im new to the host thingy and it is confusing. But its for
block “home calls” in cs5
thanks! please replyyyy!
Sorted! Thanks for the post, I couldn’t find the file for ages.
ok, i changed the host file to point to cydis’s servers a while back, and it was fine, but after a while it wouldnt work anymore, so i want to set it back to default. i have gone back into terminal and deleted the cydia ip and saved properly, but when i try to update or restore iphone or ipad, it hangs when there is just a little bit left. i dont know what else to do because it wont let me update or restore thru itunes.
Nice!
Once you have your hosts file changed, you can then use the free version of MAMP to host multiple websites on your mac! Makes testing and development a breeze!
http://www.olij.co.uk/whitenoise/mamp-lamp-for-mac-hosting-multiple-sites-without-the-pro-version/
i have to find file 74.208.10.249 gs.apple.com in my host files and the remove it to updrade to ios5 on my iph 3gs. it do and get error 3002 and to get rid of this i was fillowing links to find that file in host and remove it. in host files i couldnt find that file. can someone plz tell me where do i find that file on mac 10.6.8 and itunes 10.3.1 thanks heaps
For non-jailbroken devices:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
#74.208.105.171 gs.apple.com
#74.208.10.249 gs.apple.com
#127.0.0.1 gs.apple.com
For Jailbroken devices:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
#74.208.105.171 gs.apple.com
#74.208.10.249 gs.apple.com
The last line did not have the #, so that might have to be removed if this doesn’t work.
I tried to modify my hosts file in order to access facebook because it is blocked in my country. However, I deleted all the info from my root hosts system by mistake. my hosts file is now just an empty and blank box. I can’t do anything. Please help me to get anything that was original from my hosts file. Thx
Thanks very much, worked…
what happens if you completely didn’t see that you had to patch your host list before installing the trial??!! my computer screen ended up having this texture background to it. i have now deleted all adobe files and turned the internet off. HELP! what can i do?!?!?!?!?
[…] How to edit the hosts file in Mac OS X – Leopard « Decoding the Web (tags: mac osx host) […]
thanks!!
[…] Source […]
[…] fastest (quick&dirty) way is to edit your hosts file: https://decoding.wordpress.com/2009/04/06/how-to-edit-the-hosts-file-in-mac-os-x-leopard/ Add: 10.10.10.1 mywebsite.com Replace 10.10.10.1 with the IP of your Ubuntu […]
Please Help,
When i type : sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit /etc/hosts
I get this error message:
2011-08-20 13:42:21.191 TextEdit[717:1907] PersistentUI: LSSharedFileListInsertItemURL() failed at inserting URL file://localhost/etc/hosts
This only happened in one of the 3 new macbook pro i purchased…All of the other oppens the host file with text edit normally.
Can anyone help me?
Thanks.
Hi
I’m trying to “activate” Photoshop CS5 and adding the activation stuff in etc file does save but the flush doesn’t seem to say it’s flushed. It just goes to the next line ready for another command.
A) is that correct
B) if it is, it’s still managing to communicate with Adobe – are there new activation URL’s we need to add? I’m running out of serials to use now it seems.
I’m running the very latest Lion.
Cheers.
[…] […]
Nice post buddy
[…] URL is http://local.host:8001. To make that work, I also had to map 127.0.0.1 to local.host in my hosts file (note that that link has you using nano to edit it – I like to navigate to the directory and […]
After the terminal prompt the passwords, I try to put my user passwords. However, I could not type anything at all. Until I press ctr and c it now allow me to type. When I type my user password it can not found. What should I do to edit my host file
thanks for the tip man..
But it seems that there is a DNS issue and I have to manually add in the DNS servers’ IP addresses and search domains(I used my ISP’s) in order to work.. However, the speed is abit slower though.. any better solution for this??
thanks!
use textwrangler if you don’t want to use nano. In terminal, navigate to /private/etc/ and use the command “open .” to open a finder in that location. Then use textwrangler to open the hosts file to edit.
[…] Link to edit your host file on a Mac. […]
thank you!
great help!
[…] credit to gentschi on the Apple forum and decoding.wordpress.com for the info for this work around, […]
[…] How to edit the hosts file in Mac OS X Leopard Decoding the WebApr 6, 2009 Editing the hosts file in Mac OS X Leopard, is a pretty easy task, especially if you are familiar with the […]
i need to delete some hosts files b/c im trying to get back into my blocked/hacked account vkontatke.ru so this is what i was told to do to fix the problem, but i really dont know what im doing and i dont wanna delete something i dont know, so what should i do?
[…] […]
I have Lion and when i do the following the correct doco comes up… but it’s locked?? i didn’t have this problem on snow leopard.. help
Awesome issues here. I am very glad to see your article. Thank you so much and I am having a look ahead to touch you. Will you kindly drop me a e-mail?
Hey I cannot type my password on the terminal application
[…] in the local host-file which is accessed even before the DNS and for me that worked. There is a Howto for OSX here, do a search for »edit host file + yourOS« to find out for other Systems. I got Youtube’s […]
[…] […]
hi anyone knows how to redirect a page in a website instead of a website???
example:
127.68.9.16 http://www.goyk.com/flash.asp?path=2465
anyone help me pls??????
Здравствуйте ! Меня трогает содержание:
На нашем сайте вы можете узнать все о
Будто правильно понять это?
hi anyone knows how to point any entered url to http://www.goyk.com/flash.asp?path=2465 instead of ipaddress???
example:
http://www.goyk.com/flash.asp?path=2465 http://www.google.com
iwant to scare someone with that flash when he goes to porn sites…
any idea of it please share thanks…
Hello
When I’ am following the steps I come in a Empty screen of my host.. The Mac is clean computer is that normally?
Regards Niels
[…] To edit hosts file please follow one of the following articles according to your OS Mac : How to edit the hosts file in Mac OS X Windows : This may sound silly suggestion to even post on Windows Reference but will help avoid […]
[…] (it also touches on the idea that *nix-based systems have the same file) and here’s a great blog post touching on the same thing, with the content focused on […]
thanks!
Is this FAKE? Why does it give me this message afte rthe FIRST step:
“WARNING: Improper use of the sudo command could lead to data loss
or the deletion of important system files. Please double-check your
typing when using sudo. Type “man sudo” for more information.”
MAKES ME HORRIBLY UNEASY.
Hey, weer iets bijgeleerd op deze website 😉
This is the response l am getting can someone help me
Last login: Tue Mar 13 15:57:28 on console
HLONIPHANIs-MacBook-Pro:~ hloniphani$ sudo nano/private/etc/host
Password:
sudo: nano/private/etc/host: command not found
HLONIPHANIs-MacBook-Pro:~ hloniphani$ sudo dscacheutil-flushcache
sudo: dscacheutil-flushcache: command not found
HLONIPHANIs-MacBook-Pro:~ hloniphani$ sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit/etc/hosts
Password:
sudo: /Applications/TextEdit.app/Contents/MacOS/TextEdit/etc/hosts: command not found
HLONIPHANIs-MacBook-Pro:~ hloniphani$ sudo nano/private/etc/host
sudo: nano/private/etc/host: command not found
HLONIPHANIs-MacBook-Pro:~ hloniphani$
There is a space between nano and the path, sudo nano{space}/private/etc/host, as well as dscacheutil{space}-flushcache. That’s why you have been getting “command not found”. Just copy paste the exact commands from the post above.
[…] 3. Now through your Notepad, navigate to Computer > Local Disk (C:) > Windows > System32 > Drivers > Etc. > Hosts and add text from this file @ the end of the HOSTS File like in the image below and than Save it. If you are on Mac than you can check this tutorial. […]
[…] (use this tutorial for further […]
I never worked before on Mac and this was very helpfull to me.
Thanks a lot.
[…] the HOSTS File like in the image below and than Save it. If you are on Mac than you can check this tutorial. Abode Hosts […]
If you use your Mac like a windows PC, then you can ignore the last command and just restart your Mac. That works as well.
this shit is complicated wtf
so many comments.. which is the best way to do this thing? i cannot figure out.. anyone? please help?
[…] If you use Adobe products than you might know that their products are simply awesome. If you are a Graphic Designer or a VFX Professional you might be using one or another product from Adobe like Photoshop or After Effects well these two are mine favorite too. But there is a small problem that these products are not free so you need to purchase them in order to unlock their full potential. So I just gathered few serials which can be used to make these products full version and boost your creative performance. So below I have created a full tutorial on how you can use these serials, as you need to mod your Hosts file to get them accepted. If you do not follow steps accordingly than you might not be able to get them into work so check out tutorial carefully. 1. First step is to install your product as a trial version, well you can install them individually or you can install Master Collection. 2. So after you have installed your product do not run it just close it and than go to Start and search for Notepad and run it as an administrator. 3. Now through your Notepad, navigate to Computer > Local Disk (C:) > Windows > System32 > Drivers > Etc. > Hosts and add text from this file @ the end of the HOSTS File like in the image below and than Save it. If you are on Mac than you can check this tutorial. […]
After tracing through these forums and much confusion I have just edited the Network settings to ensure that there wasnt a conflicting IP address Instead of editing the host file. I belive this is all that that is being edited within the host file. I have managed to set it up this way and its all running fine.
Its usually allways just the simple things, However many people for get to check these first, myself included.
[…] Beginner Geek: How To Edit Your Hosts File Mac: How to edit the hosts file in Mac OS X – Leopard Catch All: Wikipedia ‘Hosts’ […]
on installing the adobe master collection, after pasting the sudo nano /private/etc/hosts / and pressed enter…. and some error it shows and then it asks for password on next line…. and then i write my password, and host file doesnot open…… what to do ???
Vickie do you press enter after you wroth your good password? ? Because when you are typing there wouldn’t show you some stars or anything! its invisible!! After that it will show you i think 10 lines of words/symbol! it’s start with this one —> #
Reblogged this on pakholeungprofile.
[…] in the screenshot below. If you are a MAC user then see how to edit your hosts file on MAC OS X here.4. Now save this file and run your Adobe CS5 Product.6. There are different serials for Windows and […]
when you type in $ sudo nano /private/etc/hosts you can only read what is in hosts file
when you type in sudo nano /private/etc/hosts (without $ in the beginning, then it prompts with password and you can edit hosts file
this was my little discovery 🙂 maybe it will help to someone
Thanks for the no-fail instructions.
It is posible to edit the hosts file in Mac OS X? without an admin password. thanks!
It’s complicated and you have to search ever the commands MAC SUCKS!
[…] How to edit the hosts file in Mac OS X – Leopard « Decoding the Web. Tagged config, hosts, osx. Bookmark the permalink. « Developers Needed! Participate in the Visual Studio 2012 Beta Exam Process – Born to Learn – Born To Learn – Born to Learn […]
[…] More detailed Mac Instructions here: […]
This is what solved it for me: The line ending of my hosts file were Mac Classic (CR), which is wrong. Open it using TextWrangler ( http://www.barebones.com/products/TextWrangler/ ) and on the bottom of the window, in the middle, you must change is to Unix (LF) and save it. Boom, worked.
have to stay with very slow site access, don’t understand a word of the instruction. :-((
Ok, so nobody seems to have an issue with the fact that when dealing with these HUGE lists, there’s no way to edit large portions of them using the mouse highlight/select function. How do you delete something like a giant list that has just been imported without pressing the delete key over and over again for 15 years?
nano does not come bundled with OSX Mountain Lion, so I downloaded the source code, compile it using command line tools of XCode 4.5.2 and followed the listed instructions.
To me, moving to Mac has been some learning experience. Little tips from forums like this really make a huge difference.
Thanks a lot.
How can we back the default host file in Mac OS X?
How can we go back to the original host file if something goes wrong?
[…] the HOSTS File like in the image below and than Save it. If you are on Mac than you can check this tutorial.4. So now you have completed the main step which will help you in getting your serial accepted, […]
[…] something else by modifying a kind of a personal phone book called your “hosts” file. Editing this file you can, for example, change the less than memorable 10.0.1.16 to something like […]
I have a problem with this. After successfully writing my admin password and entering the host file, it says: “You don’t own the file “hosts” and don’t have permission to write to it. You can duplicate this document and edit the duplicate. Only the duplicate will include your changes.”
I have no idea what to do! I am logged in as admin and I have written my password.
All I want to do is to permanently block a stubborn pop-up ad website that freezes Safari down. Why does it have to be so *insert suitable word of choice* hard? If anybody can help me, I would be very thankful.
Some ahole copied your work – without even bothering to say thanks.
http://blog.grapii.con/2012/08/how-to-edit-the-hosts-file-in-mac-os-x-10-8-mountain-lion/comment-page-1/#comment-29486
Slightly modified URL so as not to give him undue backlinks
I hope that Google will take care of the duplicate content, and rank it appropriately. Thanks for mentioning it!
[…] flush your DNS cache [how to in Windows / how to in Mac OS X], restart your browser and watch your favorite show […]
[…] Thanks to decoding the web […]
[…] which most likely is not your server. Here’s some info on how you do this on Windows 7. Same information if you’re on a Mac. You can verify that your hosts file is being picked up by your OS by […]
Hello, I have an issue, yesterday I did everything as listed on here and my PS5 stopped working it tells me it cannot be opened because it may be damaged or incomplete.. ?
[…] just do what i edit, null route her blog to your host files – here is howto for your windows, mac and linux respectively. Just add the entry “127.0.0.1 xiaxue xiaxue.sg” and […]
This is really helpful. Thankssss! 😀
Btw, how about in VIM? How can I save? I tried to use Command S, but it saved in a different directory. O__O
Press the Escape key, and then type :wq
[…] instead of the article, giving me a chance to realize that I’d really rather not. This is how I edit my Hosts file on the Mac. Windows users can do a version of the same thing, and there are also plug-ins for […]
Ctrl+O executes “Open file”, so how to send Ctrl+O to the terminal window instead?
sry i’m a nub, can anyone please kindly explain to be baby steps pls?
After all these years, you still help me out buddy 🙂 Searched for “edit hosts file on mac” and your post came up first! 🙂
Great 🙂
thank you…Great.. 🙂
[…] to edit the hosts file here: for Mac users | for Windows […]
[…] seems to work in 10.6.1 according to one comment. Thanks decoding! He has some other network related information at his website if you need more help. I tested this […]
Just blocked a couple of pages that I waste my time on frequently during the exam prep period. I turned on my apache server and my fancy page telling myself to study and mapped the sites to 127.0.0.1(me) so I get my page when trying to access those pages 🙂 Thx
[…] Hosts File – Help Desk Geek Win XP: Windows XP Tutorial: Editing the Hosts File – YouTube Mac: How to edit the hosts file in Mac OS X ? Leopard | Decoding the Web Mac: How to edit the hosts file in Mac OS X 10.8 ? Mountain Lion | Grapii You'll need to add the […]
[…] Hosts File – Help Desk Geek Win XP: Windows XP Tutorial: Editing the Hosts File – YouTube Mac: How to edit the hosts file in Mac OS X ? Leopard | Decoding the Web Mac: How to edit the hosts file in Mac OS X 10.8 ? Mountain Lion | Grapii You'll need to add the […]
[…] going to have to use the Terminal. It’s really not that difficult. I promise. Just follow this nice, simple tutorial and, when you get to the part that says “simply append your new mappings”, append the […]
[…] https://decoding.wordpress.com/2009/04/06/how-to-edit-the-hosts-file-in-mac-os-x-leopard/ […]
[…] On Mac : https://decoding.wordpress.com/2009/04/06/how-to-edit-the-hosts-file-in-mac-os-x-leopard/ […]
[…] Quelle: https://decoding.wordpress.com/2009/04/06/how-to-edit-the-hosts-file-in-mac-os-x-leopard/ […]
[…] Using An Apple Mac? On Mac, the steps are more detailed and being honest, we mainly use Windows for development, so here is a relevant link: https://decoding.wordpress.com/2009/04/06/how-to-edit-the-hosts-file-in-mac-os-x-leopard/ […]
[…] the solution. Originally posted on the blog “Decoding the Web.” Original link: https://decoding.wordpress.com/2009/04/06/how-to-edit-the-hosts-file-in-mac-os-x-leopard/ […]
[…] OS X ดูวิธีแก้ไฟล์ hosts ที่นี่ […]
[…] from here […]
[…] OS X ดูวิธีแก้ไฟล์ hosts ที่นี่ […]
[…] For MACs, this is how you edit the hosts file. […]
[…] Make sure you can view hidden files and have admin privileges. Mac `/private/etc/hosts` Use this tutorial for further instructions. Linux `/etc/hosts` Use this tutorial for further […]
work with my Macbook..
thanks! 🙂
http://terabytestore.com
[…] More detailed Mac Instructions here: […]
[…] How to edit the hosts file in Mac OS X – Leopard […]
[…] Editing the Host File on Mac OS X Leopard by WordPress […]
[…] so you’re going to have to use the Terminal. It’s really not that difficult. I promise. Just follow this nice, simple tutorial and, when you get to the part that says “simply append your new mappings”, append the […]
Useful information.
[…] and use that alias in URL instead of IP. A comprehensive manual of how to make aliases you can find here. At the end my URL looked like […]
[…] Here’s a link – https://decoding.wordpress.com/2009/04/06/how-to-edit-the-hosts-file-in-mac-os-x-leopard/ […]
[…] https://decoding.wordpress.com/2009/04/06/how-to-edit-the-hosts-file-in-mac-os-x-leopard/ […]
[…] Instructions on how to do this on Mac OSX Leopard are here: https://decoding.wordpress.com/2009/04/06/how-to-edit-the-hosts-file-in-mac-os-x-leopard/ […]
[…] could try to edit the hosts file and redirect the application’s requests into the void that is […]
[…] fastest (quick&dirty) way is to edit your hosts file: https://decoding.wordpress.com/2009/04/06/how-to-edit-the-hosts-file-in-mac-os-x-leopard/ Add: 10.10.10.1 mywebsite.com Replace 10.10.10.1 with the IP of your Ubuntu […]
[…] Here’s a link – https://decoding.wordpress.com/2009/04/06/how-to-edit-the-hosts-file-in-mac-os-x-leopard/ […]
[…] could try to edit the hosts file and redirect the application’s requests into the void that is […]