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

IKVM C# to Java Interop with Callback using IKVM

I've started using IKVM to translate Java libs into .NET CIL. I can successfully write a C# program that pulls in (inproc) a translated Java assembly as a reference and make calls to the translated Java code. My question is, is anyone familiar w/…
mj_
  • 5,781
  • 5
  • 33
  • 69
3
votes
0 answers

MAMP PRO Slow Loading Pages When Connecting to Remote DB)

My problem is this: I've installed MAMP Pro (2.1.4) on my Mac OSX 10.8.3 (Mountain Lion) and have created two new virtual hosts. test1.dev test2.dev test1.dev is a website running on Concrete5 CMS. I have all the files hosted locally but the…
norsewulf
  • 491
  • 5
  • 21
3
votes
1 answer

What permissions should /private/etc/hosts have on Mac OS X 10.8.2

I had multiple terminal windows open using SSH to access a webserver behind reverse proxies and was making changes to my hosts file to alternate between the webserver and public ip. While not paying attention I accidently executed sudo chmod 777…
James
  • 3,173
  • 3
  • 36
  • 56
3
votes
4 answers

Switching up the hosts file in a development environment

While developing websites (using win7) I find myself changing the IP addresses in my hosts file quite often. I have a development environment on my machine, code on the testing server, code on the staging server and code on the live server. I…
Michael Gorham
  • 1,136
  • 2
  • 15
  • 24
2
votes
0 answers

Unable to access website added in hosts file in MAC OSX

I have added a hostname in the /etc/hosts/ file in Mac OSX,when i try to run the URL with the hostname in the browser i couldn't able to access it , but when i try to access it with IPAddress I could able to access it. Observations: 1)I can able to…
Fedrick
  • 527
  • 2
  • 8
  • 26
2
votes
1 answer

Why does /etc/hosts not work anymore for some websites on Big Sur?

For years I’ve used /etc/hosts to adjust IP address. Sometimes it’s for prototyping, or adding an address for development purposes that isn’t ready to go into public DNS. And sometimes I block certain domains that I don’t want to visit by…
andrewdotn
  • 27,806
  • 6
  • 80
  • 110
2
votes
0 answers

Android add domain and ip to hosts file programmatically

I want to set temporary domain and ip to hosts file. which only activate when the app is running. i want to make app work like Hosts go which works well on not rooted too. what i'm trying to do is the server is running on Lan computer. so when app…
krozero
  • 4,041
  • 3
  • 17
  • 28
2
votes
4 answers

using bash with sed how to extract ip from a hostname command and saving it in /etc/hosts file

I want to store an entry in the /etc/hosts file for the IP of the box that I am on. When I run the following command I get: :-$ hostname ip-10-55-9-102 I want to store this entry in /etc/hosts as following: Expected result: 10.55.9.102 …
Saffik
  • 689
  • 9
  • 28
2
votes
1 answer

Checking hosts file entry with PHP?

I'm creating a 'domain locking' script. Basically, the script will check my website to make sure that the host its running on is allowed to run it. I don't want them to be able to modify their host file to reroute the connection. Is there a way to…
Rob
  • 7,540
  • 25
  • 71
  • 113
2
votes
3 answers

Getting hosts file location in Java

How can I get the location of the hosts file when using my application on different platforms?
Arjan
  • 1,860
  • 2
  • 16
  • 21
2
votes
3 answers

XCOPY hosts file on vista from a batch file

I need a command to replace the hosts file on my machine. Seems pretty straight forward but I cannot get the command to work with xcopy. Any obvious flaws in the command? luaexec -w -f "XCOPY" "%ScriptPath%/ModifiedHosts/vista/hosts"…
Joe
  • 409
  • 2
  • 8
  • 19
2
votes
1 answer

hosts file on windows azure website

I have a ASP.NET website in windows azure that uses a web reference. I use azure as my QA environment and on QA, the site should connect to the QA web reference. On my previous QA environment, I used hosts file entry to point the web reference…
Arbi
  • 53
  • 4
2
votes
1 answer

Windows hosts file and IIS binding question

I'm building a few SharePoint sites, and I want to make use of zones so I may set security different in the various zones. My workstation has a local SharePoint, and I use it for development. My workstation has a static IP, and is connected to the…
bmw0128
  • 12,710
  • 22
  • 65
  • 110
2
votes
2 answers

Blocking all of tumblr from hosts file

I am trying to block tumblr, and all it's pages, using my hosts file. Usually I would just add an entry like 127.0.0.1 tumblr.com to my file, but tumblr has websites in the format " sitename.tumblr.com" I have tried 127.0.0.1…
Rich Williams
  • 1,223
  • 2
  • 8
  • 8
2
votes
1 answer

Selenium: Is there a way to change the hosts file on the machine the server is running on

I want to make the browser open a local url with a name of the live url. Meaning that when I do: sel.open('http://live-url/) selenium will actually open the local url. One would test this by changing it's hosts file but this is impossible when…
Guy
  • 12,478
  • 25
  • 61
  • 86
1 2
3
8 9