Questions tagged [hosts]

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

/etc/hosts is the configuration file with locally known mappings between domain name and ip address. It can be used to define new or override existing mapping, bypassing the DNS that would normally resolve it.

265 questions
202
votes
13 answers

hosts file ignored, how to troubleshoot?

The hosts file on Windows computers is used to bind certain name strings to specific IP addresses to override other name resolution methods. Often, one decides to change the hosts file, and discovers that the changes refuse to take effect, or that…
Superbest
  • 5,045
  • 3
  • 14
  • 11
74
votes
10 answers

Can I specify a port in an entry in my /etc/hosts on OS X?

Possible Duplicate: How to use DNS to redirect domain to specific port on my server I want to trick my browser into going to localhost:3000 instead of xyz.com. I went into /etc/hosts on OS X 10.5 and added the following entry: 127.0.0.1:3000…
Tony
  • 4,053
  • 10
  • 34
  • 29
53
votes
2 answers

CNAME record/alias in windows hosts file?

Is it possible to enter some sort of CNAME record or alias in the windows hosts file (C:\Windows\System32\drivers\etc\hosts)? Basically I want to forward all requests made to host A to host B, without having to hard code the IP address (which…
MEMark
  • 631
  • 1
  • 5
  • 8
40
votes
8 answers

Assign multiple IPs to 1 Entry in hosts file

I have a web sever that connects to an internal database through a VPN. There are 2 IPs (primary and secondary) to the database from the web server. How can I setup my /etc/hosts file so that if the primary IP is not available then the secondary…
Mike T
  • 413
  • 1
  • 4
  • 5
38
votes
3 answers

"My unqualified host name (foo.bar) unknown" Problem

When trying to start sendmail or send a mail using a wordpress plugin, this error shows up in the maillog: "My unqualified host name (foo.bar) unknown; sleeping for retry" After Googling the best advice was, "add foo.bar to the /etc/hosts file",…
Richard Stelling
  • 1,467
  • 2
  • 19
  • 25
35
votes
2 answers

How is DNS lookup configured for OSX Mountain Lion?

If I cat my resolv.conf, I see this message: # # Mac OS X Notice # # This file is not used by the host name and address resolution # or the DNS query routing mechanisms used by most processes on # this Mac OS X system. # # This file is automatically…
Ben Flynn
  • 485
  • 1
  • 4
  • 8
24
votes
1 answer

Hostname to Localhost with Port - OSX

I am trying to run multiple Node.js web servers locally on my machine. Because the code I'm writing needs to reference a domain name I'd like to keep a convention of dev.myHost.com and point that to the non-port-80 service running from Node…
mondo
  • 383
  • 1
  • 2
  • 4
24
votes
13 answers

HOSTS file being ignored

My (Windows XP, Professional, v2002, SP3) workstation is completely ignoring my hosts file. Here is the code in my hosts file: 127.0.0.1 localhost 172.17.1.107 wiki But, when I open a browser and type "wiki" in the URL bar and hit "Enter"…
cmcculloh
  • 979
  • 2
  • 8
  • 14
23
votes
1 answer

How can /etc/hosts be used to associate multiple domains with a single IP?

I have a single IP (81.174.66.48) and I would like to use /etc/hosts to associate multiple domains with that IP. Currently my hosts file looks like this: 81.174.66.48 nerto.it nerto I would like eventlog.it and eventlog.in to also be resolved to…
Luca Romagnoli
  • 347
  • 1
  • 2
  • 5
23
votes
4 answers

hosts file seems to be ignored

I have almost fresh Ubuntu desktop box. OS was installed two weeks ago and updated from karmic repositories. Last week I had no problems with DNS. But this week something had changed. I'm not sure what and when, and not sure whether I changed any…
z4y4ts
  • 333
  • 1
  • 2
  • 6
19
votes
5 answers

How to have Windows Server DNS use hosts file to resolve specific host names

[NOTE: The solution of this question is perfect, by something stray away from what the title indicates.] I'm facing a small problem with Windows Server 2003 DNS service. In my corporation, I'm running Microsoft DNS server(172.16.0.12) to do name…
Jimm Chen
  • 1,709
  • 5
  • 17
  • 32
17
votes
6 answers

Per-user hosts file

Is there a way to define host aliases (like in /etc/hosts) on a per user basis, i.e. in a file /home/user/.hosts ? My primary objective is to easily share host aliases via rsync between the machines in my small lan. Since there is no machine that…
mrucci
  • 358
  • 1
  • 2
  • 10
17
votes
1 answer

How to manually trigger an update of /etc/hosts in WSL?

When I start the first WSL terminal (ubuntu 20.04 bash in my case), WSL generates the /etc/hosts file based on the host file of my windows system %WINDIR%\System32\drivers\etc\hosts. If I now change the %WINDIR%\System32\drivers\etc\hosts, e.g. add…
René Link
  • 273
  • 1
  • 2
  • 6
16
votes
3 answers

Do entries in local 'hosts' files override both forward and reverse name lookups?

If I have the following entries in a hosts file: 192.168.100.1 bugs 192.168.100.2 daffy.example.com 192.168.100.3 elmer.example.com. Will IP->name resolution attempts by local utilies (I assume using 'gethostbyaddr' or the Windows…
Murali Suriar
  • 10,166
  • 8
  • 40
  • 62
15
votes
7 answers

What can cause a DNS lookup to ignore a hosts file entry?

I'm having a DNS resolving issue that is affecting the performance of my locally hosted web site when browse it on my local machine. If I attach my network's DNS suffix to my local machine name when I go to the URL in my browser, the site has…
Dan Herbert
  • 253
  • 1
  • 3
  • 6
1
2 3
17 18