Jump to content
russellsnr

Add line in your hosts file

Recommended Posts

Hi, I am not sure if you will be allowed to answer this question but!!

I want to add a line in line in C:\Windows\system32\drivers\etc\hosts

I am on a win 7 machine

I have added the line into the host but before I do so there is already one there starting with 127.0.0.1

should I delete this line first then add the new one starting with 127.0.0.1 or run them side by side ?

Many Thanks

Share this post


Link to post
Share on other sites

Here Read This. Should b insightful.

If not post back here & if it is post back here ;)

Good luck,

dirty ;}

 

Many thanks for the help, couldn't get it to work so ended up buying the software I needed.

Thanks Again

Russ

  • Like 1

Share this post


Link to post
Share on other sites

Try avoid deleting that line even tough it is a commentary (a "#" in the beggining of the line), instead add what you want to add in new lines, here is an exemple of mine:

 

#	127.0.0.1	   localhost
#	::1			 localhost
192.168.0.1	router1
192.168.0.2	router2
192.168.0.4	km4
192.168.0.6	user1
192.168.0.7	user2

 

I use it to simply address machines in the network by the name given in "hosts" file instead of their IP address.

For more information read the commentaries at beggining of the "hosts" file itself. Here it is to save you time:

 

# Copyright © 1993-2009 Microsoft Corp.

#

# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.

#

# This file contains the mappings of IP addresses to host names.Each

# entry should be kept on an individual line.The IP address should

# be placed in the first column followed by the corresponding host name.

#The IP address and the host name should be separated by at least one

# space.

#

# Additionally, comments (such as these) may be inserted on individual

# lines or following the machine name denoted by a '#' symbol.

#

# For example:

#

# 102.54.94.97 rhino.acme.com # source server

# 38.25.63.10 x.acme.com # x client host

 

 

Hope this help you.

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×