hosts-file

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" "%windir%/system32/drivers/etc/hosts" /H The /R flag does not seem to help and the error I get is "Err...

DNS resolving based on client IP

I want to configure bind/write driver that resolves DNS requests based on the ip address of the client. We want to unify the domain names of all test environments for our web application. Instead of having many domains like test.mysite.com, qa.mysite.com, etc for different staging environments we want only to have www.mysite.com and mak...

Best way to determine if a domain name would be a valid in a "hosts" file?

The Windows Hosts file allows you to associate an IP to a host name that has far greater freedom than a normal Internet domain name. I'd like to create a function that determines if a given name would be a valid "host" file domain name. Based on this answer and experimentation of what works and doesn't, I came up with this function: pr...

Windows GUI tool for enabling/disabling hosts file entries?

When doing customer tests on web sites or web applications that rely on specific host headers, it might be necessary to temporarily add one or more lines to the hosts file on the customers PC. While this is certainly doable with any text editor (even Notepad), it might not be something the customer is able to do on her own. If several i...

localhost working 127.0.0.1 broken in Safari

I'm running an http server on a non-standard port on a Mac Powerbook G4 running OSX 10.5.8 and attempting to open a page in Safari 4.0.4. When I use the IP address 127.0.0.1 in the url Safari shows an error: Safari can’t open the page “http://12.34.56.78/” because the server where this page is located isn’t responding where the IP ...

blocking website via hosts file not working?

Hi, I'm trying to block a website using the hosts file using this tutorial : http://hackspc.com/how-to-block-a-website/ but It doesn't work, the website I'v blocked In this case facebook still shows up, please can anyone help me out here? Thanks, parastar ...

Does hosts file exist in iphone? How to change it?

I am developing an application that query to the server. In my Mac, I use the hosts file to change the dns to point to a local server within my local area network. Now I need to test it with my iphone, the problem is that my iphone does not recognize that server due to the missing configuration for dns. Within my mac or windows, I simp...

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 running on many machines. ideas? ...

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 internet. When I make a SharePoint site, I want to add a host header, for instance, devbox...

Customise DNS per-process

Is it possible (on Windows) to simulate a "per-process" hosts file? Or, is it a feature of any current web browser to be able to customise the DNS mapping? Edit: For example, a side-by-side test lab scenario simulating a future DNS change. It would be neat to avoid having to use two separate computers! ...

How can I programmatically edit the hosts file in Windows 7/Server 2008?

I'm writing a little WPF utility to manage entries in the hosts file for dev purposes. As you might know the hosts file is protected by the newer OSs (Win 7/2008/Vista). I've added a manifest to my application to set the requestedExecutionLevel to "requireAdministrator", as detailed here (using "the easy way") and in the related questio...

hosts file with multiple entries crashes browsers

127.0.0.1 www.whatever.com 111.1.1.1 www.whatever.com 127.0.0.1 www.whatever.com The 111.1.1.1 in the second line can be any non-127.0.0.1-address. Under Windows XP, Firefox/Chrome. Why is it that this configuration will crash a browser? ...

Bind DNS host pointing name servers to different IPs

Okay, at the moment i have my domain's host file which was generated by the Webmin control panel. I have a box to myself with several IPs and i want to make use of more than one. I don't fully understand everything to do with host files but I know enough to get by. Can anyone suggest how i would go about changing the below host file to m...