Home » Questions » Computers [ Ask a new question ]

Hostname redirection using Hosts file

Hostname redirection using Hosts file

We can use C:\WINDOWS\system32\drivers\etc\hosts file to map hostname with IP addresses like this

Asked by: Guest | Views: 200
Total answers/comments: 2
Guest [Entry]

"From wikipedia :

The hosts file contains lines of text
consisting of an IP address and one or
more hostnames, each field separated
by white space (blank or tabulation
characters). Comment lines may be
included; they are indicated by a hash
character (#) in the first position of
such lines. For example,

#This is an example of the hosts file
127.0.0.1 localhost loopback"
Guest [Entry]

"You may have got the impression that some kind of 'redirection' is possible from things like

127.0.0.1 ads.stackoverflow.com

in your hosts file. Purely as an example, you understand. This does not conflict with the usual definition of localhost elsewhere in the same hosts file.

The Internet has a number of sample hosts file which ensure that unwanted images don't appear on your screen."