Questions tagged [hosts]

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.

Filter by
Sorted by
Tagged with
250
votes
8answers
531k 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 ...
17
votes
5answers
107k 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 ...
17
votes
1answer
17k views

Cannot ping my local machine

I have just updated my Mac to macOS Sierra 10.12. My hostname is ninjaPixels-Macbook-Pro and if I run: ping ninjaPixels-Macbook-Pro.local or ping ninjaPixels-Macbook-Pro I get an error of unknown ...
16
votes
6answers
99k 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 ...
16
votes
6answers
32k 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 ...
13
votes
1answer
6k 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 ...
8
votes
3answers
16k 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: ...
7
votes
3answers
22k 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. ...
7
votes
2answers
15k views

Local hostname is already in use on this network?

When I turned my computer on this morning this is the message I received: This computer's local hostname "----Macbook-pro.local" is already in use on this network. The name has been changed to "------...
7
votes
2answers
2k 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 ...
6
votes
1answer
4k 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> ...
6
votes
5answers
32k views

why cannot I edit my `hosts` file?

I'm trying to edit my hosts file, because doing ssh <some host in hosts> fails to translate to ip. according to the Finder UI it is found under: however when trying to run cat hosts from the ...
6
votes
1answer
894 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
11k 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 ...
4
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 ...
4
votes
1answer
107 views

Route with /etc/hosts on computer to computer network

Is it possible to change the /etc/hosts file so that the routing is used when a peer to peer network is created, for example, in my /etc/hosts file, I have thisismylaptop.com mapped to 127.0.0.1: 127....
4
votes
3answers
596 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
1answer
642 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
685 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
1answer
904 views

Protect hosts file

I am under the impression that there is no real way to protect the hosts file completely without creating a none-admin user account on my Mac and setting the password of the admin account to one that ...
3
votes
2answers
243 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 ...
3
votes
1answer
3k 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
4k 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
362 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
637 views

How to block an app's access to a specific website using the hosts file?

I want to block an app from connecting to a specific website using the hosts file. How can I do that? Is something like this possible: 127.0.0.1 foo.com:spotify
3
votes
1answer
11k 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 ...
3
votes
2answers
7k 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
1answer
133 views

Danger in not maintaining known_hosts file?

I am not sure what all hosts I have accumulated over time under my ~/.ssh/known_hosts file are. Is there any risks in keeping all hosts' addresses or doesn't it make any difference?
3
votes
2answers
797 views

Adding website to block via /etc/hosts not working

I block some websites via /etc/hosts on my machine. But for reddit.com it does not work. What does I have to do? ## # Host Database # # localhost is used to configure the loopback interface # when ...
3
votes
1answer
2k views

Blocking a website

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 ...
3
votes
1answer
788 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
1answer
2k 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 System....
3
votes
2answers
2k 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 ...
3
votes
1answer
2k 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, ...
3
votes
2answers
4k 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
708 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
5answers
4k 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
3k views

How can I delete one of my devices from the “lists of known hosts (ECDSA)” after connecting to it with SSH?

How can I delete one of my devices from the "lists of known hosts (ECDSA)" after connecting to it with SSH on Sierra ?
2
votes
3answers
3k 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: ...
2
votes
2answers
898 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 I'...
2
votes
1answer
15k 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
4answers
6k views

Mojave Hosts File

Was there some new behavior around the /etc/hosts file in Mojave? Cannot get the thing to pick up any new entries which I make in the file. I am restarting the DNS resolver thingy, and I vetted my ...
2
votes
3answers
624 views

how to add ip routes with host name instead of ip address?

I want to add IP routes for host that I do not have the IP address for. I basically want tell macOS to search for a host in a specific interface: sudo route add -host <myHostname> -iface en7 ...
2
votes
1answer
894 views

Editing/removing hostfile on jailed iPhone

So guys I've done a very silly thing. I've installed a tweak that blocks ad websites, but apparently it blocks every connection on the internet(things using DNS, but now all the things use it) I only ...
2
votes
2answers
59 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 ...
2
votes
1answer
41 views

Not able to resolve my domain name on browser

I am using docker for application and modified the hosts file and added domain name on local browser. I added in hosts: 127.0.0.1 xyz.com but when I am trying to open from browser getting the ...
2
votes
1answer
71 views

Incorrect hostname in terminal after factory reset

I wiped out Mac and reinstalled (Mojave) (logout from Cloud, Messages, deauthorized iTunes, erase disk, reinstall). Now my terminal is showing a name that I set up through Preferences -> Sharing on ...
2
votes
2answers
483 views

OSX Sierra, trouble with virtual hosts

I'm trying to create a separate virtual host on a Mac for a local project, which would not be http://localhost/ibb but, for example: http://ibb.local. For this I carefully followed the next ...
2
votes
1answer
158 views

my local development /etc/hosts redirect works only on chrome

I am confused why my host name in /etc/hosts works for Google Chrome only. Not on Safari, not on Firefox, not from command-line tools like curl. ## # Host Database # # localhost is used to configure ...
2
votes
0answers
106 views

Before update to High Sierra httpd-vhosts.conf is empty

I just upgraded from Sierra to High Sierra. Apparently everything works fine. But when testing my works in local (Web developments in PHP, etc) I see that none works. Checking and looking for where ...