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
1
vote
1 answer

How does linux resolve wildcard locahost subdomains (e.g. : `ping test.localhost`) when `test.localhost` does not exist in /etc/hosts or dns server?

For example in ubuntu 20.04 LTS where the /etc/hosts file is empty: >>> cat /etc/hosts 127.0.0.1 localhost ping still works for any subdomain of localhost: >>> ping test.localhost PING test.localhost(ip6-localhost (::1)) 56 data bytes 64…
Greg
  • 1,657
  • 5
  • 27
  • 38
1
vote
2 answers

How do I serve a localhost projects on a made up domain, such as mysite.test and testing.test simultaneously?

If this is possible it would save a lot of headaches. I would like to bind made up domains to localhost projects, if that is possible. I am on Ubuntu 20.10.
eoyath
  • 21
  • 2
1
vote
1 answer

Exclude subdirectory from host resolution set in /etc/hosts (with dnsmasq, or anything else)

I have a local development tool (LocalWP) that sets the path to my local environment by modifying /etc/hosts. For example, if I set my site in Local to www.foo.com, it'll append the following to the hosts file: 127.0.0.1 www.foo.com This is fine,…
Orun
  • 157
  • 1
  • 6
0
votes
1 answer

Why proxy server don't use the ip in client hosts file but do dns query?

A website changed DNS server,unable to get the correct ip with the normal dns query. So I have to write domain&ip to etc/hosts (macOS). I can only access this site faster if I use a proxy. Local hosts file seem to be ignored when use a proxy , and…
maP1E bluE
  • 163
  • 8
0
votes
1 answer

Why does name resolution work for a .local adress without DNS?

Recently, I added a FreeNAS server to my local network. I can reach its web interface by opening freenas.local in a browser on my main Windows machine. However, when I do a nslookup freenas.local from the same Windows machine, there are no…
Liam Bew
  • 1
  • 1
0
votes
1 answer

Named multicast address

Is it possible to name a multicast or broadcast address? Usually for a single machine I'd put a line in /etc/hosts. Will that work for a multicast address?
z0r
  • 165
  • 2
  • 9
0
votes
1 answer

changed hostname - website no longer accessible

I run Centos 7 i was changing /etc/hostname "centos-512mb-blr1-01" to "srv1.domain.com" and rebooted for the changes to take place, since then all my websites are off.. i tried reversing the change.. but still getting ERR_CONNECTION_TIMED_OUT Here…
perlware
  • 33
  • 1
  • 5
0
votes
0 answers

local IP redirects to public

I have a website on ubuntu vps.I can access my website through my public valid IP (185.211.88.62) but when computers on local network are not connected to internet and want use local invalid IP (172.16.1.103) it redirects to public ip and not…
chimia
  • 28
  • 1
  • 4
0
votes
2 answers

Fiddler-like host and port remapping using nginx on Linux

I am trying to set up host and port remapping on Linux using nginx as a reverse proxy. So far, I've got a working ghetto hack solution using the if directive, which is evil. Is there a better solution without using if? What I have tried - nginx…
0
votes
0 answers

Access Apache VHost Domain through OpenVPN

In my company, we're using OpenVPN to connect to our network for remote-working We have a local server that our employees can access (so through the VPN too), which contains a lot of local websites served by Apache VHost The problem is, we have…
Plotisateur
  • 101
  • 1
0
votes
1 answer

LXC container ignores etc/hosts

I'm trying to map a hostname to a ip address on a lxc container because the hostname will not be resolvable by DNS. The lxc.conf of the container contains lxc.mount.entry = /sas/mycontainer/etc/hosts etc/hosts none ro,bind 0 0. Insinde the hosts…
sahisb
  • 31
  • 5
0
votes
1 answer

Redirect website login to different IDP

My organization has a Shibboleth/IDP service set up. Now that I am getting involved, I am first setting up my own basic IDP on a test server to learn the ropes. In order to test functionality, I want to be able go to one of our production sites and…
0
votes
2 answers

Route to a specific server depending on origin address

I want to have some Windows computers point (map) to one server, and other Windows computers to point to another server - but using the same "FQDN". Ideally, the routes should be based on subnet location of the Windows computer. This can be achieved…
MrBeatnik
  • 83
  • 1
  • 1
  • 8
0
votes
5 answers

apache2, vhosts and servername directive

I'm running an apache development environment on my ubuntu desktop machine. When I start apache, I get the error "apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName ... waiting apache2:…
bob
0
votes
0 answers

ICINGA2 - wrong host status (DOWN/UP) for a while

I have setup and configured ICINGA2 server on Ubuntu 16.04 LTS. I added majority of my hosts (mainly Windows hosts) and I noticed that sometimes ICINGA2 shows wrong hosts status for a while (1 minute or so). For example plenty of my hosts are DOWN…