The hosts file, used to map hostnames to IP addresses. This tag is for questions relating to usage of this file, including reading and modifying its contents to change which IP a hostname is mapped to.

learn more… | top users | synonyms

131
votes
8answers
287k views

How to change computer name so terminal displays it in Mac OS X Mountain Lion? [duplicate]

When I setup my computer I named it "Scott's MacBook Pro". And so when I go to System preferences->Sharing, it says Scott's MacBook Pro there as my computer name. However, opening up a terminal gives ...
10
votes
4answers
65k views

Add a hosts file entry without jailbreaking

I have an iPad that needs to be able to connect to a server via its short hostname, e.g. http://app instead of http://app.example.com. The network it connects to assigns it a domain name other than ...
8
votes
6answers
39k views

problem accessing localhost on Mac OS X Mavericks…it was working fine until I rebooted today

I am perplexed about the problem I am having and would really appreciate help resolving it. I have an iMac running Mac OS X Mavericks 10.9.2 I have set up my apache to serve documents from the ...
8
votes
1answer
3k views

User specific hosts file in Mac OS X

I'm working on an OS X 10.6.8 machine, for which I do not have superuser privileges. I'd like to imitate the effect of adding an entry to the hosts file, i.e. have a certain domain resolve to a ...
7
votes
3answers
19k views

Cannot access localhost after upgrade to Mavericks but can access 127.0.0.1

I ran across this question, but it wasn't resolved (and it hasn't been touched in a while). I'm not sure if my issue is the same, but I don't have enough reputation here to comment on that question. ...
6
votes
5answers
12k views

How to edit the /etc/hosts file?

When I open the file with TextEdit (I don't want (truly, I am not able) to use vim), it is seen as "locked", even if I modify the permissions of the file via the "Get Info" window. How can I modify ...
5
votes
1answer
3k views

Chrome slow when loading local virtual host

I'm developing a local website with MAMP. I've configured a virtual host (hosts files, and apache vhosts). /etc/hosts file: 127.0.0.1 domain.com MAMP Vhosts config <VirtualHost *:80> ...
4
votes
3answers
508 views

How do apps get loaded on iOS for free

I have Googled over and over and cannot get an answer to a fundamental question I have. To get an app downloaded onto an iPhone, do I need to open an apple account of some sort and pay for the account ...
4
votes
2answers
946 views

Shared Internet apply /etc/hosts

How do I make those who connect to me via a shared internet connection use my /etc/hosts file? I was thinking something along the lines of creating a DNS server, but I was hoping maybe there is a ...
4
votes
1answer
389 views

What are these google host entries that keep showing up automatically in my etc/hosts file?

I went to edit my /etc/hosts file and found a bunch of entries for google urls that I never put there. When I try to delete it, it just comes back. I tried searching google for it but to no avail. ...
4
votes
1answer
533 views

DNS: Search Domains not working correctly?

I am running OSX Lion. I've looked all over the web for solutions to the issue I'm having and can't find a fix. I've found several entries where uses are trying to resolve custom_hostname.dev (etc, ...
3
votes
2answers
259 views

when is the /etc/hosts file loaded?

I'm trying to configure some virtual hosts and I'm quite confused as to when this file is loaded. At what point is /private/etc/hosts loaded? When logging in? At every DNS call? When Mac OS restarts? ...
3
votes
2answers
2k views

Lion “hosts” File Bug

I have some serious problems with the hosts file on my Lion 10.7.2. My hosts file is like following; 127.0.0.1 localhost 255.255.255.255 broadcasthost ::1 localhost fe80::1%lo0 localhost 27.0.0.1 ...
3
votes
1answer
6k views

How to stop Windows firewall from blocking Bonjour hostname resolution

I have Bonjour installed on my Windows 7 PC, and the installer appears to have poked all the necessary holes in the Windows firewall. However, I can't ping windows-pc.local from my Mac. If I ...
3
votes
2answers
2k views

Unable to save hosts file after adding websites to block.

I'm unable to save hosts file after adding websites to block,as well as unable to flush cache. I am not a techie, just researching on the web, and trying to follow directions for terminal and Text ...
3
votes
1answer
235 views

How set up a local domain such as local.test?

I'm web-developer and I need local domains. Before 10.7.2 update, I'm just fix /etc/hosts as I need, but new update crash this solution. How fix this new "feature"?
3
votes
1answer
2k views

Can entry duplicates (or multiples) in etc/hosts do any damage?

Can entry duplicates in etc/hosts do any damage? For example: ## # Host Database # # localhost is used to configure the loopback interface # when the system is booting. Do not change this entry. ...
3
votes
2answers
5k views

Editing Hosts File to Redirect URL to different IP Address

When I edit my hosts file to redirect a URL to a specific IP address, nothing happens. My hosts file looks like this - 199.204.138.195 zionica.com this is in the directory /private/etc/hosts. I am ...
3
votes
2answers
39 views

Where to insert a custom item in /etc/hosts file?

The default /etc/hosts file looks like this: 127.0.0.1 localhost 255.255.255.255 broadcasthost ::1 localhost fe80::1%lo0 localhost If I want to insert a custom item, should I insert it after the ...
3
votes
1answer
171 views

Hosts file being reset after every reboot

My /private/etc/hosts file is being reset after every reboot. I can make my changes, save the file, and it will work. Right up until I reboot my Mac. Has anyone found a work around for this or a way ...
3
votes
2answers
3k views

Sites blocked in /etc/hosts often doesn't work

I'm using a Macbook Pro as a productivity/work machine and have Facebook and reddit blocked with /etc/hosts: ## # Host Database # # localhost is used to configure the loopback interface # when the ...
3
votes
2answers
692 views

Unable to revert changes to hosts file in OS X Lion

I edited the hosts file and added: 10.0.0.1 devsys.crossreader.net Later I commented out the entry: #10.0.0.1 devsys.crossreader.net When I ping or browse to devsys.crossreader.net the returning ...
2
votes
4answers
3k views

How make changing to the /etc/hosts file take effect?

I added some lines to my /etc/hosts file to resolve a private hostname, but every time after rebooting, the lines I added get lost. Should there be any setting options to make these changes take ...
2
votes
2answers
698 views

Changing permissions on /etc/hosts

I frequently (at least once per day) need to edit my hosts file, and typing my password every time is getting annoying. I know how to change the permissions to allow myself to write to the file, and ...
2
votes
2answers
227 views

Why does OS X's Apache server give different results using real and virtual addresses?

I'm developing a WordPress site on my Mac, running OS X 10.6.4. I'm using OS X's built-in Apache server to run the site locally during development. I've set up WordPress and connected it to OS X's ...
2
votes
1answer
14k views

Multiple IP addresses for same host name in /private/etc/hosts?

I have a corporate mail account (exchange 2007) that uses a self-signed SSL certificate. No matter what I do, Mail always complains about this when I connect. If I look at the details it always says ...
2
votes
2answers
579 views

Mac OS X Mavericks DNS name lookup order change?

I noticed Mavericks prefers the DNS server to /etc/hosts (scutil --dns). There used to be a good 'ol "order hosts,bind". Is there anything equivalent for Mavericks so my hosts file is consulted before ...
2
votes
1answer
701 views

Adding hosts entry to iOS in absence of DNS

I am working with an application where my iPhone needs to see my laptop on the network under its host name and not the IP address because the SSL certificate works with the name only. At the office, ...
1
vote
3answers
379 views

How can I force Google SafeSearch on my kids' Mac?

I'm pretty sure there's a way to force enable Google Safe Search by editing a hosts file on my kids' Mac. Can someone tell me how? I'm guessing I need to sudo nano /etc/hosts According to How to: ...
1
vote
1answer
158 views

I Would Like To Host an HTML Website Without Using Server.app

I am somewhat a novice when it comes to the Apache web server. I currently host Ruby on Rails applications on my Mac Mini Server (Mavericks) using Phusion Passenger. I know that some of the config ...
1
vote
3answers
6k views

How to edit the hosts to block IP address?

I know how to block certain website, like if I want to block google I can use this line in the host 0.0.0.0 www.google.com.hk www.google.com.hk But my question is how can I block certain IP ...
1
vote
1answer
6k views

osx hosts file not working

my hosts file looks like this it should open facebook if you try to open google 173.252.110.27 google.com ## # Host Database # # localhost is used to configure the loopback interface # when the ...
1
vote
1answer
269 views

10.8.2 DNS in hosts lookup slow

As a web developer, I need to make a domain redirect to localhost. I modified the hosts file to do that. But I don't know why it always took so long to do the lookup. How can I solve this?
1
vote
1answer
125 views

Blocking an IP address

I need to block a particular website on my Mac (OSX 10.11.1, El Capitan). I have already made the changes to /etc/hosts but the website is still not blocked when testing from Chrome. I think this has ...
1
vote
1answer
632 views

/etc/hosts will not update/refresh at all

I add to my /etc/hosts file this : 127.0.0.1 youtube.com Save the file. Flush everything with : dscacheutil -flushcache; sudo killall -HUP mDNSResponder Reboot my computer 30 times. Then I run: ...
1
vote
1answer
515 views

Multiple .local hostname on one computer

Is possible setup multiple .local hostname on one physical computer? Background: home network (behind the DSL/NAT router) (192.168.1.*) have a mac-mini, called as "tango.local". (set in the ...
1
vote
1answer
195 views

Getting home.dev to resolve to 127.0.0.1

In my hosts file 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 ...
1
vote
1answer
431 views

OS X Server 3.0 - DNS & Server Names

I have two Mac Mini's running Mavericks Server. The hostnames for them are as follows: macsvr01.mydomain.com macsvr02.mydomain.com I want to be able to access macsvr02 by going to ...
1
vote
1answer
128 views

Admin in Terminal, logged on Family's session

I have a weird problem. I'm trying to connect on my VPN with Mac 10.7.5 (Java 7 U45, Citrix Receiver 11.8) but when I do, JSam is not able to write in Hosts file. So my Mac session is called "Family" ...
1
vote
3answers
1k views

Cannot use ssh/ping domain name after connecting to openvpn

I've got two macs, both on the same network, both using Tunnelblick to connect to vpn. Both with same settings. Both connect fine and both have the same settings for DNS and search domain applied ...
1
vote
1answer
1k views

Using hosts file on Mac OS X Snow Leopard

I have added two new host entries in /pricate/etc/hosts 127.0.0.1/wys/sub-folder local.wys 127.0.0.1/les/sub-folder local.les I have flushed the DNS using dscacheutil -flushcache I ...
1
vote
0answers
63 views

OSX etc/hosts not blocking one particular site

I've used etc/hosts to block a lot of sites without issue, however I'm trying to add in filterbypass.me to the list but it won't work. I've tried adding: filterbypass.me as well as all the ...
1
vote
0answers
495 views

iOs Simulator ignoring Hosts file

I'm actually working on a website development and I configured all the needed hostname on my /etc/hosts files. Actually in our office we use an internal DNS for the QA servers and we override ...
1
vote
0answers
19 views

How can I send an email from within iCloud.com using a different email address? [duplicate]

I have my own private domain hosting solution with email, for example, test@test.com. When I am using the iCloud.com website from my browser, let's say for creating a spreadsheet, I will want to shed ...
1
vote
0answers
58 views

Weird local domain behaviour

I just clean installed mavericks on my mac and local domains i use for web development still work. Surely clean install wipes the host file, so how is this possible? Its not really a problem, i am ...
1
vote
0answers
153 views

macbook pro hosts file not working correctly

I am trying to set up a production server ahead of the actual dns switch. I have edited my hosts file on my macbook pro 10.8.2. I can pull up the index page but none of the style sheets are pulled ...
0
votes
1answer
1k views

Adding an entry to the hosts file on iPod touch 4G?

Is it possible to add an entry to your /etc/hosts type file (or whatever the equivalent is) on an iPod Touch 4G without jail breaking it?
0
votes
2answers
66 views

What happens if I edit a duplicate Hosts file?

What exactly is a duplicate file? When I wanted to edit the hosts file (/private/etc/hosts), it says: You don't own the file "hosts" and don’t have permission to write to it. You can ...
0
votes
2answers
5k views

How to redirect out going traffic to an IP address to another host name?

How can I redirect an IP say 203.130.48.8-bj-cnc or 203.130.48.8 to Google.com in host file (or other places)? It looks like host file doesn't redirect an ip address (only the domain names).
0
votes
1answer
2k views

What is localhost.pharos from Netstat?

Over past week, netstat reflects an established connection to localhost.pharos. Googled Pharos and it's a software which enables printing services at Universities/Enterprises. Any ideas why ...