Questions tagged [hosts]

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

Filter by
Sorted by
Tagged with
212 votes
13 answers
580k views

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 ...
Superbest's user avatar
  • 5,345
76 votes
10 answers
183k views

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

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....
Tony's user avatar
  • 4,253
56 votes
2 answers
232k views

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, ...
MEMark's user avatar
  • 661
50 votes
9 answers
157k views

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 ...
Mike T's user avatar
  • 513
44 votes
3 answers
89k views

"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 ...
Richard Stelling's user avatar
36 votes
3 answers
58k views

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 # ...
Ben Flynn's user avatar
  • 495
29 votes
1 answer
40k views

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 ...
Luca Romagnoli's user avatar
25 votes
13 answers
72k views

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 ...
cmcculloh's user avatar
  • 989
24 votes
4 answers
65k views

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 ...
z4y4ts's user avatar
  • 343
24 votes
1 answer
35k views

Hostname to Localhost with Port - OSX [closed]

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 ...
mondo's user avatar
  • 383
20 votes
5 answers
94k views

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 ...
Jimm Chen's user avatar
  • 1,759
18 votes
1 answer
17k views

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

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 ...
René Link's user avatar
18 votes
6 answers
14k views

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 ...
mrucci's user avatar
  • 368
17 votes
5 answers
135k views

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 ...
Dan Herbert's user avatar
17 votes
3 answers
48k views

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 ...
Murali Suriar's user avatar
13 votes
5 answers
3k views

Renting a dedicated, but getting a VPS. How to detect? [duplicate]

When renting a dedicated server, how can one be certain than he/she is not getting a VPS or some other virtual machine variant instead of a true dedicated hardware box? Which checks can be run (...
mr-euro's user avatar
  • 858
13 votes
2 answers
23k views

/etc/hosts , /etc/sysconfig/network and hostname?

I need to do the hostname changes on a centos server which will serve www.myserver.com What do I need to do in /etc/hosts, /etc/sysconfig/network and with the hostname command? In /etc/sysconfig/...
benjisail's user avatar
  • 1,331
12 votes
7 answers
19k views

Can a long /etc/hosts file slow DNS lookup?

I'm facing a little question here. I have a long /etc/hosts file. (working in the web, so I'm hosting a lot of sites locally for developping). Let's says it is about 40, 50 lines long. All ...
Zenklys's user avatar
  • 583
11 votes
2 answers
35k views

Can host aliases be assigned to deployments in Kubernetes? If so, how?

This article describes how to assign host aliases to pods in kubernetes, is there anyway to do it for a deployment and not for a pod as such? Any other suggestions to add host entries in kubernetes ...
Ulukai's user avatar
  • 919
11 votes
3 answers
3k views

Size Limit of /etc/hosts (Linux)

Does anyone happen to know what the theoretical size limit of /etc/hosts is on a Linux system before you might start to see degradation in performance? Furthermore, can anyone point me towards some ...
MikeP90's user avatar
  • 113
10 votes
2 answers
14k views

Hostnames in HAProxy configuration file

My haproxy.cfg file has two backend servers using hostnames: server ops-ca-revealv2e-prod-1 ops-ca-revealv2e-prod-1:443 cookie ops-ca-revealv2e-prod-1 ssl weight 1 maxconn 512 check server ops-ca-...
Naijaba's user avatar
  • 203
10 votes
2 answers
1k views

How to add non-latin entries in hosts file

Is there a way to add non-latin entries in /etc/hosts on windows? Something like 127.0.0.1 локалхост Tried the code above and also punycode with no luck Yes, i know that this would break almost ...
Drath Vedro's user avatar
8 votes
1 answer
13k views

How is priority determined in /etc/hosts?

For reasons too specific to detail here... I have tried to add two entries for a domain to the /etc/hosts file on a CentOS-7 server. In order for one piece of software to run happily, there needs to ...
Chris Throup's user avatar
7 votes
2 answers
511 views

How do I setup a HOSTS file on different operating systems?

Please provide examples of how this can be setup on client and server versions of various operating systems.
Brian Lyttle's user avatar
  • 1,757
7 votes
2 answers
12k views

What's required for a nameserver to be registered?

I'm trying to change nameservers for some of my domains at GoDaddy, but I occasionally run into "Nameserver not registered" problems, and then I'm not allowed to set the nameservers. Here are the ...
Lin's user avatar
  • 2,949
7 votes
5 answers
9k views

DHCP: Logging host declarations in log file

I am currently running ISC-DHCP server v3 on Ubuntu 8.04. What I am trying to do is log Who got what IP address when. Currently in the DHCP log file you can see the following: DHCPDISCOVER from ...
jinanwow's user avatar
  • 453
7 votes
3 answers
16k views

Is it true that hosts doesn't work in VPN?

C:\WINDOWS\system32\drivers\etc\hosts Seems it's no longer working after I switch on the VPN. Is it the case ,or just my own mistake?
flv's user avatar
  • 83
6 votes
6 answers
29k views

hostname -f says "hostname: the specified hostname is invalid". Guess why?

hostname -f says "hostname: the specified hostname is invalid". The hostname (FQDN) specified in /etc/hostname is also listed in /etc/hosts and is pingable. No actual DNS server yet of the host knows. ...
Ivan's user avatar
  • 3,398
6 votes
3 answers
582 views

Same IP on many systems in different environments

I work in an environment where there are multiple locations, and in each locations we have the same IP addressing scheme, that is, we have many machines (one in each location) that share the same IP ...
Dan Nestor's user avatar
5 votes
5 answers
6k views

Add temporary entry to hosts, when tunnelling SSH

When outside our company firewall, I use a script to tunnel via SSH and expose our internal wiki to my OSX machine. Is there a command to temporarily tell OSX to resolve to my local port when the ...
pufferfish's user avatar
  • 2,900
5 votes
8 answers
7k views

Using a Virtual Windows Machine to browse a local website: is it possible?

During our webdevelopment process, we often need to test the layout of our applications and websites in several browsers. Since running all of these browsers stand-alone is nearly imposible and ...
Aron Rotteveel's user avatar
5 votes
2 answers
11k views

Squid proxy server ignoring hosts file :(

Using: Squid Cache version 2.7.STABLE3 for i686-pc-winnt ... Whatever I put into the hosts file, it seems to be ignoring it. here's my configuration :- ... hosts_file c:\windows\system32\drivers\...
Pure.Krome's user avatar
  • 6,608
5 votes
2 answers
2k views

sendmail on ubuntu (9.10) machine "stopped" sending mail

I'm developing on my ubuntu 9.10 machine for the web (php). I'm using it sendmail for sending mails, and while developing on my local machine, I send local mails (to my user 'doron'). Up until a ...
Doron's user avatar
  • 553
4 votes
7 answers
6k views

Setting a custom /etc/hosts or resolver for one process only in Linux

On Linux, I want that a particular process should resolve host "xyz.com" to IP "10.1.2.3". That's easy: just add a line to /etc/hosts. However, I only want to do this for one process; I want all ...
SRobertJames's user avatar
4 votes
3 answers
2k views

Alternate to /etc/hosts

We have a server on which we host private services. These services can also be access from rest of the world but there is slight difference on application level based on from which IP request came. ...
Shoaibi's user avatar
  • 819
4 votes
5 answers
48k views

Internet Explorer not bypassing proxy for local addresses

I've got a machine here that's running a website. It's only really a development machine but it has IIS on it for testing purposes. Problem is that when pages get loaded in internet explorer using the ...
Daniel Revell's user avatar
4 votes
3 answers
10k views

How can I have a user specific hosts file

Is it possible to configure user specific hosts file instead of a common /etc/hosts. For example if user "user1" tries to get the name for the IP: "127.0.0.1", he gets "dev.user1" and if user "user2" ...
Supratik's user avatar
  • 2,174
4 votes
1 answer
23k views

Is it possible to add a wildcard CNAME into dnsmasq?

I would like to let the DNS works in round robin way. So I have to put an entry into /etc/hosts. However, this does not allow wildcard domains. Is there any way that I can do this in dnsmasq? So I ...
Wang's user avatar
  • 322
4 votes
1 answer
1k views

Use of alias in /etc/hosts or ssh_config

I'm have configured a bastion or (jump) box to access a virtual private network. #ssh_config Host bastion HostName 14.90.140.120 User me IdentityFile ~/.ssh/me ForwardAgent yes Host 10.1.* User me ...
bearrito's user avatar
  • 380
4 votes
2 answers
4k views

make dnsmasq ignore specific entries in /etc/hosts

I've set up a machine running dnsmasq, essentially serving its /etc/hosts file. However, there are specific entries which I want in that machine's /etc/hosts, but I don't want served. How can I make ...
einpoklum's user avatar
  • 1,722
4 votes
3 answers
20k views

Howto use Apache virtualHost with etc/hosts

I'm trying to have http://www.mysite.com and http://test.mysite.com running on a production webserver, and now I'm doing some basic tests in local machine before transfering the datas on the ...
ling's user avatar
  • 303
4 votes
4 answers
4k views

Windows 10 Name Resolution skipping/ignoring subnet

This is a rather complex problem, but I'll try to make it easy to understand: I have three subnets. We'll call them 10.10.0.0/22, 10.20.0.0/22 and 10.30.0.0/16. I have two AD domains, but I don't ...
C Hamm's user avatar
  • 81
3 votes
6 answers
29k views

Use Windows Hosts File To Redirect External Url to Subdomain?

I'm going to just post this question and I'll edit it if the community determines it needs elaboration or clarification. The Issue I got what I thought was a brilliant idea today. I shop Amazon.com ...
Eric Hepperle - CodeSlayer2010's user avatar
3 votes
3 answers
8k views

Redhat doesn't set my desired hostname on reboot

I have a redhat (EL5) server that I need to change the hostname on. I'm trying to put it back into a known state to help with server provisioning activities. As part of changing the hostname, I'm ...
user avatar
3 votes
1 answer
2k views

Mapping all subdomains of a domain to an IP

How should I set up a server to map all subdomains of a domain to an IP? I wish I could do something like that in the hosts file: 127.0.0.1 *.example.com
Emanuil Rusev's user avatar
3 votes
2 answers
2k views

Is it good to define localhost as 127.0.0.1 in your hosts file?

I just came across a server that does not respond to things like ping localhost or mysql -h localhost - I believe this is because localhost is not defined in the hosts file. On just about every ...
cwd's user avatar
  • 2,793
3 votes
4 answers
590 views

Windows Hosts File Location

I've got a general query regarding the location of the hosts file on Windows. It resides at this location: f:\windows\system32\drivers\etc\hosts My question is why? Could Microsoft have picked a ...
Jonathan Holloway's user avatar
3 votes
3 answers
284 views

My DNS works! But, what is the simplest way to add something to it?

This is my current DNS example.com.db zone file. I followed a tutorial. It works, because when I point to this DNS from another server via resolve.conf, it will actually forward me to the right IP ...
Alex's user avatar
  • 8,591
3 votes
1 answer
6k views

How to define multiple /etc/hosts entries with Puppet ENC?

I'm writing an External Node Classifier for my Puppet infrastructure, and I have the need to manipulate the /etc/hosts file on each node. The following (due to the duplicate key) is invalid YAML: --- ...
Chris Tonkinson's user avatar
3 votes
1 answer
9k views

How to configure ldap to resolve host names?

I'm new to LDAP and I already configured accounts with LDAP so I can login on few computers with LDAP. Now I would like to add some host names to LDAP. In /etc/nsswitch.conf I changed: hosts: ...
klew's user avatar
  • 723

1
2 3 4 5 6