/etc/hosts is the configuration file with locally known mappings between domain name and ip address.

learn more… | top users | synonyms

53
votes
6answers
20k views

Can I create a user-specific hosts file to complement /etc/hosts?

Is it possible to add a list of hosts that are only specific to a certain user? Perhaps a user-specific hosts file? This mechanism should also complement the entries in the /etc/hosts file.
6
votes
2answers
16k views

Format of /etc/hosts on Linux (different from Windows?)

Pasted below this question is a sample of a /etc/hosts file from a Linux (CentOS) and a Windows machine. The Linux file has two tabbed entries after the IP address (that is localhost.localdomain ...
8
votes
5answers
2k views

Host lookup that respects /etc/hosts

Utilities like host and dig let you see the IP address corresponding to the host name. There is also the getent utility that can be used to query /etc/hosts or other NSS databases. I am looking for ...
3
votes
2answers
900 views

Wget - Mirroring a full website with requisites on differents hosts

I am trying to make a full static copy of a wordpress website with wget to be browsed without any network connection (all links and images must be converted). The different requisites for the pages ...
9
votes
1answer
1k views

Why does SSH not consult /etc/hosts?

I'm administrating a networked environment where the users authenticate over NIS. All machines can be used to SSH into the server but one. On the machine in question, I get the message ssh: connect ...
3
votes
2answers
14k views

/etc/hosts for Debian

I was trying to get a perl script that contacts a PostgreSQL database to work on a server. This script was mysteriously failing. I then realised that localhost was not in the /etc/hosts file. The ...
1
vote
2answers
363 views

Simple command that switches between two host files

I am using /etc/host to map localhost to a web domain. I would like a fast way of doing this rather than searching and replacing every time. I put this in my .bashrc file. alias hostchange=' ...
3
votes
1answer
264 views

Blocking Websites with /etc/hosts

There's a website, www.example.com, that I tried to block myself from accessing because it wastes too much of my time. So I configured my /etc/hosts file. I added the following lines, to block the ...
3
votes
3answers
2k views

/usr/bin/host not picking up changes to /etc/hosts even after reboot

I have a Ubuntu Server 12.04 (amd64) machine on which, when I change /etc/hosts, the changes aren't picked up, even after a reboot. I am using /usr/bin/host to test, but none of the other programs ...
1
vote
1answer
45 views

Block a certain URL?

I want to deny access to a specific URL. It isn't a whole website, it's a specific URL. I want to do it simply so that some applications including browsers can't make requests for it. I tried this: $ ...
1
vote
2answers
163 views

How to change the name of localhost to a custom name which is available to other users in LAN

I need to use the a custom URL name which is accessible from all devices in a LAN. I know that it can be set in the /etc/hosts file 127.0.0.1 myname 127.0.1.1 system09-System-Product-Name # The ...