is it possible to replicate a host file between computers?

nageov3t

Lifer
Feb 18, 2004
42,816
83
91
ignore the whole "why" of why I need to use the host file. haha. it's a work thing and there's no great way around it because I've got to manage multiple client machines on different domains over a private network. we use the host file on our internal servers to point their private IP to our own internal names for the client servers.

the end result is that I've got 10 different internal machines that I'm trying to manage the host files on... and every time we need to connect a new client to our backend stuff, it's 10 host files to update manually (and 10 to update every time we remove a client)

is there a great way to automate this? I'd love to be able to just have to worry about maintaining one host file and have it replicate out to the other servers.
 

RaiderJ

Diamond Member
Apr 29, 2001
7,582
1
76
Maybe just set up a script that will copy a host file from a network location to the local machine? Something like:
Code:
copy z:\hosts.txt %systemroot%\system32\drivers\etc\

Have it run as a scheduled task hourly/daily/etc.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Any method of automation would need local admin access to every client PC so you would either need to replicate it across all those domains or create trusts between them and at least the 1 "primary" domain.

I believe a GPO can be used to just push arbitrary files so in theory you could do that too, again depending on domain membership and access.

But in reality you should be looking for a way to handle this within DNS, managing hosts files on any number of hosts will end up causing problems eventually.
 

VirtualLarry

No Lifer
Aug 25, 2001
56,452
10,120
126
Wait until you start using Windows 8, and it's built-in AV (Windows Defender, which is a version of MSSE) starts REMOVING your HOSTS file entries automagically.

The only solution (that I am aware of) is to disable Windows Defender.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Wait until you start using Windows 8, and it's built-in AV (Windows Defender, which is a version of MSSE) starts REMOVING your HOSTS file entries automagically.

The only solution (that I am aware of) is to disable Windows Defender.

That's just stupid if true.
 

Dstoop

Member
Sep 2, 2012
151
0
0
It isn't. Tech "journalists" aren't known to be very good at fact checking (outrage first! accuracy be damned). It seems a perfectly reasonable default behavior, but you can just exclude it from being looked at by the built in AV if you want to actually use a HOSTS file.

http://support.microsoft.com/kb/2764944

I'm gonna have to agree here. The most common uses for manually editing the HOSTS file in my experience have been related to DRM circumvention (redirect requests to the drm server to 127.0.0.1) or viruses/malware forcing redirection. The legitimate uses are so few and far between these days that for the vast majority of users resetting the file frequently is going to be a boon to their security more than a hindrance. For us tinkerers who do need it, just disable that feature in your AV. It's no more of a hassle than manually allowing a program through your firewall software.

Anyway, back on topic. If you can't arbitrarily push the file via GPO and you don't want to set up a scheduled task on every single PC to pull it from a centrally located network share, you can always configure the sync as part of the login script for each user in the domain. It relies on your users actually remembering to log out, but its better than manual editing in the event the other methods give you trouble.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
It isn't. Tech "journalists" aren't known to be very good at fact checking (outrage first! accuracy be damned). It seems a perfectly reasonable default behavior, but you can just exclude it from being looked at by the built in AV if you want to actually use a HOSTS file.

http://support.microsoft.com/kb/2764944

That makes more sense and I agree that it's fine default behavior. The hosts file is effectively a holdover from the days before DNS and has very limited usefulness these days. I would even go so far as to say MS should disable its use by default, but I don't think their DNS client has that option.
 

Ferzerp

Diamond Member
Oct 12, 1999
6,438
107
106
I use them once every few years when network changes necessitate a few systems needing to address something on a different IP address than everything else. It would be nice to have a robust way to do policy based responses for DNS without creating massive levels of complexity, but in the mean time, on the corner cases requiring it, hosts file it is.
 

xSauronx

Lifer
Jul 14, 2000
19,586
4
81
ignore the whole "why" of why I need to use the host file. haha. it's a work thing and there's no great way around it because I've got to manage multiple client machines on different domains over a private network.

do you not have control of the domains? do you get along with people managing the domains? might it be possible to get them to create DNS entries for you? ive had to do this with a medical group a few times for some legacy servers that had to be on their network or some such...but it was a mandate that users have access so i didnt have an issue getting other admins to give me dns entries when i needed them
 

imagoon

Diamond Member
Feb 19, 2003
5,199
0
0
You can deploy the HOSTS file via AD like any other file. You could also use a cron job to grab the same file for Linux hosts.
 

AFurryReptile

Golden Member
Nov 5, 2006
1,998
1
76
Do it in DNS. You'll save yourself a world of headache in the future.

If you're working with Windows servers, set up something called a "Global Names" zone. It will allow you to resolve a simple UNC names like "SERVER01" instead of requiring the entire path, like "SERVER01.domain.local"
 

VirtualLarry

No Lifer
Aug 25, 2001
56,452
10,120
126
It isn't. Tech "journalists" aren't known to be very good at fact checking (outrage first! accuracy be damned). It seems a perfectly reasonable default behavior, but you can just exclude it from being looked at by the built in AV if you want to actually use a HOSTS file.

http://support.microsoft.com/kb/2764944

For the record, Windows Defender in Windows 7 also detects HOSTS file modifications as Malware, but unlike Windows 8, it does not automagically clean the file, instead, it prompts the user for action. Whenever it comes up for me, I just click "Ignore".
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |