Questions tagged [hosts]

A `hosts` file is used to map hostnames to IP addresses on a TCP/IP-enabled computer.

A hosts file is used to map hostnames to IP addresses on a TCP/IP-enabled computer. On Unix and Unix-like operating systems (Linux, OSX, FreeBSD, NetBSD, et al), the file is located at /etc/hosts. In Microsoft Windows, the file may be located in different places depending on the version of the operating system. In Plan 9 from Bell Labs it is located at /lib/ndb/hosts

On most systems, the behaviour of /etc/hosts depends on configuration within the /etc/nsswitch.conf file.

841 questions
5
votes
3 answers

Windows Batch to add a record to hosts file

I need a batch file to add a record to hosts file in windows, however I do not need just a file append writing because I would like to check if this record is already present. Is it possibile?
Tobia
  • 9,165
  • 28
  • 114
  • 219
5
votes
2 answers

Passing a Fabric env.hosts sting as a variable is not work in function

Passing a Fabric env.hosts sting as a variable is not work in function. demo.py #!/usr/bin/env python from fabric.api import env, run def deploy(hosts, command): print hosts env.hosts = hosts run(command) main.py #!/usr/bin/env…
mcsrainbow
  • 370
  • 2
  • 12
5
votes
3 answers

dns lookup not working while offline

i have setup my acrylic dns proxy to include some addresses to redirect to localhost- therefore i am able to redirect specific domain names to my local machine, without any need to look anything up on the internet (i don't have internet connection…
user151496
  • 1,849
  • 24
  • 38
5
votes
3 answers

localhost doesn't point to 127.0.0.1

when I ping localhost, the answer is: alsotang@alsotang-laptop:~$ ping localhost PING localhost (61.139.8.100) 56(84) bytes of data. but the hosts file has a record that 127.0.0.1 localhost How can I fix it?? ps: my system is Ubuntu 10.04
alsotang
  • 1,520
  • 1
  • 13
  • 15
5
votes
4 answers

Facebook login only works when hosts is set to localhost?

Unfortunately I keep getting this error: { "error": { "message": "Invalid redirect_uri: Given URL is not allowed by the Application configuration.", "type": "OAuthException", "code": 191 } } Login works however when my…
user1438003
  • 6,603
  • 8
  • 30
  • 36
5
votes
0 answers

host entry in android

what is the procedure to put an host Entry in android host file? we did the followings. An Entry for the URL was made in hosts file of the Android using cmd ( File Explorer -> System -> etc ->hosts ). 127.0.0.1 localhost xx.xx.xx.xx …
4
votes
1 answer

Kubernetes pull from image private network / fails to respect /etc/hosts of server

I am running a small 3 node test kubernetes cluster (using kubeadm) running on Ubuntu Server 22.04, with Flannel as the network fabric. I also have a separate gitlab private server, with container registry set up and working. The problem I am…
Aaron Murray
  • 1,920
  • 3
  • 22
  • 38
4
votes
1 answer

Use /etc/hosts/ for jenkins to resolve host

I am trying to apply Jenkins job to a host. However the host name is not resolvable. I made an entry in the /etc/hosts file: 192.168.10.10 myhosts From Jenkins server I can ping the hostname and the correct IP is resolved. However when I run my…
warhansen
  • 704
  • 1
  • 8
  • 22
4
votes
1 answer

Redirect AWS sdks' default endpoint to mocked localstack endpoints

I have multiple Java spring boot services (around 20 of them) using Amazon SDKs for S3, SQS, DynamoDB, etc.. Currently, to use Amazon Web Service I only need to specify my AWS key &…
user8429728
  • 41
  • 1
  • 3
4
votes
2 answers

node.js send http request with temporary /etc/hosts setting

/etc/hosts file allows us to specify an ip address for a domain. For example, if the content of /etc/hosts file looks like this: 127.0.0.1 www.mydomain.com It means that www.mydomain.com represents 127.0.0.1 when you type www.mydomain.com in the…
Brian
  • 12,145
  • 20
  • 90
  • 153
4
votes
4 answers

wildcard in hosts file

It's not possible to use a wildcard in the hosts file on windows or linux. Is there a way to do it with a browser plugin or something else? I have a dev server on a vbox instance so it's practically LAN. I'm creating .dev domain for my virtual hosts…
pablo
  • 2,719
  • 11
  • 49
  • 67
4
votes
2 answers

Map docker container to regular dev domain name

I'm new to docker, and have recently installed a docker container/image using the phpdocker.io (php7, nginx, mysql) generator. Started it using docker-compose and it's working awesome. If I go to localhost/phpinfo.php my regular system php version…
sh4
  • 1,217
  • 13
  • 20
4
votes
3 answers

Windows hosts file not working with ampps server on windows

I have recently switched from XAMPP to AMPPS. I'm trying to create virtual hosts on my Windows 10 machine but can't get them work. This is how I'm creating them in the hosts file: 127.0.0.1 localhost 127.0.0.1 mysite.com Then, in my httpd.conf…
LuisDev
  • 41
  • 1
  • 2
4
votes
2 answers

Where does Git Bash get all its host mappings from?

I'm using Git Bash in Windows 8. I can see it has copied C:\Windows\system32\drivers\etc\hosts over to /etc/hosts. Note that /etc/hosts is not a link to C:\Windows\system32\drivers\etc\hosts - you can prove this to yourself by modifying…
mulllhausen
  • 4,225
  • 7
  • 49
  • 71
4
votes
1 answer

Multiple virtual hosts - This site can’t be reached Vagrant/Virtualbox

I'm having problem setting multiple virtual domains. Tried so many solutions, nothing worked. I'm just missing something but have no clue what. It's been frustrating journey say the least. I have set up 2 virtual boxes: one for Laravel environment…
Verse
  • 1,403
  • 1
  • 14
  • 21