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
0
votes
3 answers

Java apps can't connect to IP, but I can ping it

I have a play application connecting to a database at 1.2.3.4 but for some reason Play! (and other java apps too) cannot connect to it. I did try editing the hosts file and setting a name for the IP like app01 1.2.3.4 however it only worked on the…
crockpotveggies
  • 11,654
  • 11
  • 65
  • 127
0
votes
4 answers

Unix - how to get IP address of domain name?

In a C program in UNIX, gethostbyname() can be used to obtain the address of domain like "localhost". How does one convert the result from gethostbyname() to dotted decimal notation. struct hostent* pHostInfo; long nHostAddress; /* get IP address…
Jake
  • 14,859
  • 42
  • 114
  • 188
-1
votes
8 answers

Denied Access to Hosts File

I just can't get into it. No matter what I do... It resulted from malware, my hosts file was "turned" into a system file that can not be altered or deleted in any way, shape or form. I have attempted numerous "Internet fixes" to no avail. Can…
ClaytonDaniels
  • 393
  • 3
  • 10
  • 24
-1
votes
1 answer

Access my web applications in PHP/APACHE without change host files

I work with Apache that is installed in a Windows Server(Windows Server 2012 R2) , so i have my web applications in the htdocs folder (in the server ofc) if i want to access the applications via other computers connected to the server i have to…
nuno1197
  • 1
  • 1
-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,943
  • 16
  • 76
  • 142
-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

Wrong entry in /etc/deny.hosts file

I mistakenly edited the /etc/deny.hosts file and added following entry- ALL: ALL. Now, I'm unable to do SSH into it. After searching, I found that it denies all users from accessing the system. Does any one have idea on how to overcome this?
Yogesh Jilhawar
  • 3,489
  • 6
  • 26
  • 46
-1
votes
3 answers

Windows hosts file auto reset?

I have an 192.168... address (local VMware) written in the local host file on Windows (administrator mode). Windows change that file after one hour and put the line with "#" as follow : before 192.168.72.128 dev.local after \# 192.168.72.128…
juvaone
  • 11
  • 4
-1
votes
1 answer

Hosts Redirect 400 Error Web Page Cannot be Found

I'm trying to test my application against the OAuth Microsoft Account Login. I have added the following to my hosts file 127.0.0.1 testdomain.co.uk My application is running over https so when I run the app it runs as…
Matthew Flynn
  • 3,167
  • 2
  • 30
  • 74
-2
votes
1 answer

How can I prevent my computer from accessing thousands of websites?

I'd like to block access to domains from my computer. This is what I tried I tried to use the domain filter in my router, but it applies only the HTTP websites. Any website that relies on HTTPS gets by the filter, even if the filter is looking for…
user106014
  • 21
  • 6
-2
votes
1 answer

PHP File Upload to remote server

I am currently having problems with testing a known working file upload script while migrating a site to a new server. I have migrated the entire site to the new server and everything works as it should apart from the original file upload script. I…
Sideshow
  • 1,211
  • 5
  • 25
  • 49
-2
votes
1 answer

Removing websites from hosts file with batch file

want to make sure this code will remove a specific website from hosts file, unblocking it. pushd %SystemRoot%\system32\drivers\etc\hosts copy hosts hosts.bak findstr /v /c:"drive.google.com" hosts.bak > hosts popd And if not then what I can use in…
keagz
  • 5
  • 1
-2
votes
1 answer

Sudo etc/hosts file not working

I want to edit my etc/hosts file. In terminal/command line on a mac i have typed in sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit Sometimes it asks for my password, I enter my password and nothing happened. Other times it doesn't even ask…
Ollie_W
  • 197
  • 1
  • 2
  • 12
-3
votes
3 answers

Edit hosts file in python

I want to map 172.16.14.54 to myblog.dexter.in in hosts file through python code. But editing hosts file requires administrative privileges. So, how to edit hosts file without administrative privileges in python on windows/mac. Please note: User…
imp
  • 1,575
  • 1
  • 24
  • 38
1 2 3
8
9