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.

271 questions
3
votes
1 answer

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: --- host: name: www1.example.com …
Chris Tonkinson
  • 475
  • 2
  • 6
  • 19
3
votes
2 answers

MySQL hosts cache: whitelist IP?

Is there a way to whitelist an IP address, so that max_connect_errors doesn't apply? The IP address for my office was blocked today due to too many connection errors to our new development MySQL server. I had to FLUSH HOSTS to allow connections…
balleyne
  • 145
  • 1
  • 6
3
votes
2 answers

Transparent Proxy or VPN that listens on all ports

I'd like traffic to be routed via a proxy or VPN based on a the client's hosts file (or DNS that is given to the client). This doesn't seem like a problem for http traffic on port 80 as a simple squid proxy can do that however I don't know which…
Dogsbody
  • 656
  • 4
  • 15
3
votes
1 answer

Virtual Host on G-Wan

I'm trying G-Wan v. 3.28 64 bits(on System: Ubuntu 12.04 64bits) to configure multiple domains on one IP address: listener 1: / gwan / 192.168.2.4_80 / #192.168.2.4 (root host) / $www.domain1.com (virtual…
ricardok1
3
votes
1 answer

Squid ignoring hosts file (using SquidMan on Mac)

I installed SquidMan 3.1 on my Mac, and it works fine. But I really need it to redirect some of the traffic using my hosts file, and it seems to be ignoring it no matter where I put it. So far I've tried: Adding a hosts_file /etc/hosts directive on…
luchomolina
  • 129
  • 5
3
votes
2 answers

Simple DNS Server or Tool for Local Web App Development

When I develop web-apps I sometimes have to hard-code full URLs into my generated markup. Even though one can generally get by using relative URLs a la Something things can get more complicated when I have to point…
user101340
3
votes
1 answer

Does not having FQDN in /etc/hosts cause any problems?

Just been looking through some servers and seen that the external ip is set up with the full and short names the wrong way round, e.g.: a.b.c.d myserver myserver.mycompany.org What sort of problems can this cause, given that nsswitch.conf is…
RCross
  • 469
  • 2
  • 6
  • 19
3
votes
2 answers

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 machine I've used localhost has been an entry in the…
cwd
  • 2,763
  • 9
  • 33
  • 48
3
votes
1 answer

Different hosts files per network on windows 7?

I'd like to be able to have seperate hosts files for different networks on windows 7. Basically, I have an internal IP address for my web server at home which I was thinking of putting in the hosts file so that I can access it using the external…
3
votes
1 answer

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: files dns ldap But I have no idea how to add…
klew
  • 723
  • 2
  • 11
  • 16
3
votes
4 answers

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 more obscure location for a hosts file?
Jonathan Holloway
  • 365
  • 1
  • 4
  • 10
3
votes
2 answers

Wireguard VPN connection not resolving local host names

I have setup a Wireguard VPN on my raspberry pi and I can connect to it via client app on my mobile phone. I can access the internet though the phone and I confirm that the phone is using the same IP of the raspberry pi, so the VPN is working for…
BMM
  • 191
  • 5
  • 10
2
votes
2 answers

Hosts file vs DNS for data center management

What are the cons and pros of using hosts files (updated via Puppet for example) vs DNS for data center machines management? I'm looking to switch from the tedious IP scheme, but concerned about using DNS as it adds another layer of possible…
SyRenity
  • 3,179
  • 11
  • 57
  • 79
2
votes
0 answers

docker-compose containers do not resolv hosts /etc/hosts entries

On my host machine (arch linux) I have a somewhat long list of entries in the /etc/hosts file resolving to remote machines (that are not under my control). The Docker containers of a development project that I recently inherited use the domain names…
2
votes
0 answers

Correct form of /etc/hosts

I've always thought that the correct format of /etc/hosts was 1.1.1.1 fully.qualified.name shortname alias We're upgrading our core software and some of the vendors utilities are failing as they require the short name to be switched with the…
user1174838
  • 616
  • 6
  • 18