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

What can be done to avoid hosts file entry?

In our organization, we've a in house maven repository say http://mymavenrepo.com to store private artifacts and that is being used across projects. But recently ip address of machine, where mymavenrepo was hosted, has changed and hence we had to…
Alpha
  • 13,320
  • 27
  • 96
  • 163
-1
votes
1 answer

haproxy.service start failed when I set up load balancer on the same machine which serves the website

I have 2 machines 192.46.209.80 # server1 192.46.209.82 # server2 I was setting up HAProxy load balancer on the same machine server1 which is also serving my website. So now server1 will be running HAProxy as well as the webserver. I setup Apache2…
Himanshu Poddar
  • 7,112
  • 10
  • 47
  • 93
-1
votes
1 answer

Remove lines from hosts file with batch if already exists

I have a batch script to add new entries based on the given IP address: @echo off SET NEWLINE=^& echo. set /p ipAddress=What is the IPv4 address of the instance? FIND /C /I "storage.app.lab" %WINDIR%\system32\drivers\etc\hosts IF %ERRORLEVEL%…
Gilbert Williams
  • 970
  • 2
  • 10
  • 24
-1
votes
1 answer

Configuring DNS Resolution without unbound.conf

I've recently ran into an issue where in I need to configure the DNS Resolution of a docker container. Basically, the default configuration for the applications we're trying to containerize needs some sort of unbound configuration for DNS…
Migsarmiento
  • 153
  • 6
-1
votes
1 answer

Directing a local URL to another public facing one

I am trying to test a web application locally. This runs on a domain such as https://abc We have some services which are created on direct links such as /services/findmesomething These services do not work locally, so ideally I'd like to point…
StuartM
  • 6,743
  • 18
  • 84
  • 160
-1
votes
1 answer

Why my hosts file is not visible even after checking the hidden files?

I am using windows 10 for a while but the problem is i cant find the hosts file in my "C:\Windows\System32\drivers\etc" folder. But when i try to create a new one in the same folder it says that there is already one file named "hosts" and asks if i…
-1
votes
1 answer

What are recommended Blog hosts for new developers?

Seeking best blog host recommended for new-coming coders. I am classifying myself as entry-level, as I only hobby code for now.
Kiersten
  • 1
  • 1
-1
votes
1 answer

How can add a range of ip addresses in windows server machine in host file?

How can add a range of ip addresses in windows server machine in host file? This is for ip based access . How can add a range of ip addresses in this file? file : C:\Windows\System32\drivers\hosts
user872297
  • 117
  • 1
  • 16
-1
votes
1 answer

Getting permission error when editing hosts file

Using python, I am trying to edit the hosts file. with open('C:\Windows\System32\drivers\etc\hosts', 'r+') as file: data = file.readlines() data[70] = '127.0.0.1 web.alanmrsa.com' file.writelines(data) print('done') When I run this…
Alan Ma
  • 19
  • 2
-1
votes
1 answer

OS X Apache2 vhosts hosts domain not working

Setting up my local dev environment due to an update in OS X pushing new Apache Files. This setup works fine when going to localhost or http://127.0.0.1 but when I setup the hosts file like so 127.0.0.1 bears.dev www.bears.dev bears.dev just…
BITmixit
  • 53
  • 1
  • 8
-1
votes
1 answer

What is the maximum length of a host in C:\Windows\System32\drivers\etc\hosts file in Windows?

I have added the following line in my hosts file: C:\Windows\System32\drivers\etc\hosts 127.0.0.1 firsthostfirsthostfirsthostfirsthostfirsthostfirsthostfirsthost The above is working fine(length is 63), able to ping and the host is responding. But…
-1
votes
1 answer

Host's hosts file in Virtual box

Does host's hosts file influence routing of requests from inside virtual box VM? I.e. if I will add something to host's hosts file will the request be routed properly from the virtual box. I guess that, if I am running image networking in NAT mode,…
Zveratko
  • 2,663
  • 6
  • 35
  • 64
-1
votes
2 answers

Windows - etc/hosts configuration not working

I made this entry in my C:\windows\system32\drivers\etc\hosts file: convert2mp3.net convert2mp3.com so that my browser always calls convert2mp3.net instead of convert2mp3.com if i accidentially call convert2mp3.com But it does not work. I also…
Black
  • 18,150
  • 39
  • 158
  • 271
-1
votes
1 answer

PHP IPV6 CIDR Calculate Total number of hosts

I am looking for a php script which will give the total number of hosts for an IPV6 IP address in CIDR format. I know that there are similar posts about this but I have not been able to get any of them to work properly so far. Any help is…
AndyC
  • 21
  • 3
-1
votes
1 answer

Cannot access locally hosted sites

I have several sites on hosted on my local iis that I cannot access all of sudden. Error I'm getting in all browsers I have installed (Chrome, IE, Edge) is- server DNS address could not be found. Last thing I was doing before things wend wrong-…
Michael Baranov
  • 789
  • 1
  • 7
  • 17