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

How to remove custom string entries from a host files using cmd?

I've entered the following into the hosts file 127.0.0.1 www.facebook.com 127.0.0.2 www.youtube.com how can I delete the above entries from the file using cmd?
jNerd
  • 179
  • 3
  • 11
0
votes
1 answer

Customising localhost URL

I want to test a web app locally. Since its using facebook api. I want of have the same url as the live one. The url of the live one in in the following structure. https://app.example.com/example I want to imitate the same URL in my local system. I…
winnyboy5
  • 1,456
  • 3
  • 21
  • 44
0
votes
1 answer

Linux/Oracle db: how to access website in same subnet using local IP address?

My Oracle 11.2 database schema has a scheduled job that queries a webpage on my website every few minutes. The database and web servers are two physical Linux machines that sit next to each other and have local IP addresses 192.168.0.11 (database)…
user46688
  • 693
  • 3
  • 7
  • 24
0
votes
1 answer

Vim: Overwrite save function for hosts file to be sudo

I have this in my .vimrc, which is a key mapping to open my hosts file in a new tab: nnoremap hs :tabe /etc/hosts:set noreadonly So now Vim won't bother me about readonly, which is great. However, when I save, I might compulsively…
Andy Ray
  • 26,451
  • 11
  • 86
  • 123
0
votes
1 answer

Possible to tell whether a DNS query is being answered by the HOSTS file?

Currently using the Dns.GetHostEntry method in our WinForms application, I discovered that some guys trying to bypass our "copy protection" by redirecting lookups to our servers to localhost by changing the IP address in the HOSTS file (i.e. they…
Uwe Keim
  • 36,867
  • 50
  • 163
  • 268
0
votes
1 answer

How to Map an IP to hostname in python without writing in hosts file

I am using windows 7 and python 2.7 I created local https server with redirect url to server as its IP address. I created cert file for https using openssl. Then I mapped my local system IP(172.16.17.84) to myapp.nobies.in in hosts file of…
imp
  • 1,575
  • 1
  • 24
  • 38
0
votes
1 answer

Changing DNS Host file in Mac OSX Mavericks

I am trying to edit the hosts file in MAC OS X Mavericks. And am trying to do something like this. sudo vim /etc/hosts Then I edit the hosts file like such, Just after the broadcasthost line I type this: 127.0.0.1:9999 www.fb.com Then I save the…
theRev
  • 109
  • 1
  • 1
  • 12
0
votes
0 answers

How to Bypass restrictions on the hosts file in windows 8 programmatically?

I want to using hosts file in windows 8 in order to block some websites by redirecting it, I knew that there are some restrictions put by Windows Defender on the hosts file in order to prevent Malicious Softwares from missing with it, I want to…
Muhammed Refaat
  • 8,096
  • 11
  • 76
  • 108
0
votes
0 answers

Editing /etc/hosts file in backtrack

I want to edit /etc/hosts file for using at localhost.I get some website html file using wget command and I put them to /var/ directory for reaching from browser while being offline.When I write "localhost" to browser,index.html file come.But when I…
0
votes
1 answer

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…
codebox
  • 18,210
  • 7
  • 54
  • 77
0
votes
1 answer

When debugging at a remote location, how do we use hosts file to do that?

If I use foo.my-company.com at work, then all works well, but if we fix any bug remotely, then the web server will respond with a forbidden. I heard we can use dev1-foo.my-company.com at a remote location, and it is the same site, but if I access…
nonopolarity
  • 130,775
  • 117
  • 415
  • 675
0
votes
1 answer

How to reference a hostname in a hosts file?

I connect to local servers on the same network as "staging.local" (where staging is the hostname on the local server). Is it possible to do the name in os x hosts file like this: staging.local mydomain.com That doesn't seem to work. Referencing…
Hopstream
  • 5,893
  • 9
  • 47
  • 77
0
votes
3 answers

UnknownHostException at the android emulator

I've got an UnknownHostException in my android application when I want to get to my web service. I inserted an at my AndroidManifest.xml. If I go to my link of webservice via browser…
Rikki Tikki Tavi
  • 2,913
  • 4
  • 37
  • 78
0
votes
0 answers

visual studio web development using IIS specific URI

I'm using Visual Studio 2010 with Web Development Tools. I have an ASP.net Web-Application and under project-settings using "Local IIS webserver" with project URL "http://localhost/test.mywebapp.com". This ends up in IIS under "Default WebSite". Now…
kalmiya
  • 2,415
  • 26
  • 31
0
votes
2 answers

My Program cannot write HOSTS file even when run as Admin

I have a strange problem. I am writing an application in C# (.Net 4 client profile) which will change entries in the HOSTS file. I added "full access" to my user account for the HOSTS file and I can edit the file without any problems in normal text…
Knowleech
  • 973
  • 1
  • 8
  • 15
1 2 3
8
9