Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automating a change in the HOSTS file

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hello,

Does anyone know of a way to distribute an entry into the HOSTS file off all the PCs on a network, instead of having to manually go around and edit it yourself manually.
Any help would be greatly excepted.
 
Using DNS is the best way, as Zelandakh mentioned, but I don't suppose your clients all use the same entries in their hosts file? If so, you could simply replace the entire file through a logon script and be done with it.

Bill
CNE, MCSE, CCNA, CCA, MCT, CCI

"I'd much rather be lucky than good"
 
You could add an entry into their login script that adds the information you want to all their Hosts tables using a dos command. We use the command to update ini files when we install certain applications. WE use the following command to add two host tables together and put it back in the right location as hosts.

ren c:\windows\hosts hosts.old
copy \host\hosts.new + c:\windows\hosts.old c:\windows\hosts /a
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top