Questions tagged [hosts-file]

The hosts file is a computer file used in an operating system to map hostnames to IP addresses. The hosts file is a plain text file and is conventionally named hosts.

The hosts file is one of several system facilities that assists in addressing network nodes in a computer network. It is a common part of an operating system's Internet Protocol (IP) implementation, and serves the function of translating human-friendly hostnames into numeric protocol addresses, called IP addresses, that identify and locate a host in an IP network.

In some operating systems, the hosts file's content is used preferentially to other methods, such as the Domain Name System (DNS), but many systems implement name service switches (e.g., nsswitch.conf for Linux and Unix) to provide customization. Unlike the DNS, the hosts file is under the direct control of the local computer's administrator.

More see at Wikipedia

134 questions
1
vote
1 answer

Watir: Alternative to change the hosts file?

I use watir to test a test version of a website. To do so, I have to modify my hosts-file Is there a way to get the same result without modifying the hosts file? The obvious idea to replace the domain with the ip-address in the calling uri does not…
knut
  • 25,655
  • 5
  • 79
  • 107
1
vote
1 answer

Windows: How to use hosts file with path?

This works: 127.0.0.1 www.somesite.com But not this: 127.0.0.1/somepath/www www.mysite.com What am I doing wrong? Is it possible to map a full path like this? If not, what is the easiest way to accomplish what I want to do here?
coderama
  • 14,202
  • 38
  • 149
  • 282
1
vote
2 answers

Update hosts file on post-build event Visual Studio 2012

I have a VS2012 project. To make it run I need a hosts file entry eg. 127.0.0.1 local.mywebsite.com The problem is I want to make it as easy as possible for new developers to simply get the project from TFS and run it without any extra steps. Is…
1
vote
0 answers

DNS.GetHostEntry - why does it require fiddling with hosts file?

I have a Windows app where the following line of C# code gets invoked IPHostEntry connected = Dns.GetHostEntry("www.somedomain.com"); It works as it should in 99% of organizations (i.e. domain name resolves to an IP address automatically), only in…
joedotnot
  • 4,295
  • 6
  • 49
  • 76
0
votes
1 answer

How to work map a name to an ip address on my Windows?

I have a website hosted on a server and I can access it using the below: http:///sites/home.aspx On my PC (Windows XP), I'd like to be able to map a name like "hello.world" to this ip address so that I can…
The Light
  • 24,407
  • 61
  • 164
  • 254
0
votes
1 answer

need Adblockplus filter systemwide via /etc/hosts

I'm scraping some websites to get at content they have using selenium in python. I can run headless firefox via geckodriver with marionette capability set to True with adblockplus extension enabled and it works well. However recent versions of…
endrias
  • 426
  • 5
  • 7
0
votes
0 answers

Ping specific IP range is not working in Mac

I have edit my /etc/hosts file as below. I am new to mac Os and try to run some codes and test. for that i have to edit /etc/hosts file. But ping for IPs not working as expected. please help me to understand the issue. # Host Database # # localhost…
nipuna
  • 545
  • 3
  • 13
0
votes
0 answers

which IP will be called if /etc/hosts has entry 0.0.0.0/0 for load balancer

Load balancer for our application myloadbalancer.myorg.net returns either of the active IP ( 165.a.b.c or 165.x.y.z ). If we keep an entry in /etc/hosts file for load balancer like below 0.0.0.0/0 myloadbalancer.myorg.net …
summary
  • 121
  • 11
0
votes
1 answer

Android emulator hosts file not working for android app

I have a react native app running on an android emulator and I'm trying to make a request to my local api(running on my laptop) at https://dev.mywebsite.com/api . This domain is host filed in the emulator like so : /etc/hosts and /system/etc/hosts…
Max
  • 2,258
  • 1
  • 17
  • 31
0
votes
1 answer

Forward Traffic with Window's Host file?

A long time ago I found some guide that showed how to use the Windows Hosts file to forward traffic to another IP/Port. We setup a clients server on one IP/Port, and they wanted it changed to another IP/Port on the same machine, but are now asking…
user470760
0
votes
0 answers

Accessing old / new site at the same time using hosts file

This is an odd request, but one I can't get my head around. We are currently building a new site on a new server, but don't want to update the DNS settings until it's ready to go, since we need a live, working site. In order to gain access to this…
IVCatalina
  • 338
  • 5
  • 19
0
votes
0 answers

How to get chrome to immediately redirect websites upon changes to /etc/hosts?

I'm creating a small npm Pomodoro timer project. When I start the project, it starts a timer, and added a list of websites to /etc/hosts file, when I terminate the project, that list is removed. My code works // all the variables let…
relidon
  • 1,394
  • 2
  • 16
  • 27
0
votes
1 answer

Jenkins slave configuration issue in linux

I am facing the below issue please have a look. Thanks in advance. Searching for lokesh in /var/lib/jenkins/.ssh/known_hosts Searching for lokesh:22 in /var/lib/jenkins/.ssh/known_hosts [06/04/20 12:59:45] [SSH] WARNING: No entry currently exists in…
0
votes
1 answer

Sidekiq can't connect to database?

I have "mariadb" set to 127.0.0.1 in my /etc/hosts file and sidekiq occasionally throws errors such as: Mysql2::Error::ConnectionError: Unknown MySQL server host 'mariadb' (16) The VM is not under significant load or anything like that. Later edit:…
Nick M
  • 2,010
  • 4
  • 25
  • 42
0
votes
1 answer

How to Load My Non-Public Site via HTTP (No SSL Config) - All Browsers Auto-Redirect to HTTPS

I need to load my website via HTTP, but all browsers automatically redirect to HTTPS. I have no SSL setup on the site (the domain name is not registered anywhere), nor is the server expecting SSL (AFAIK). I also run into this when I register a new…
1 2 3
8 9