Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Would it be possible to use robocopy to copy the host file from one server to multiple servers (less than 10 total)?

We have servers that rely on having identical host files and this would be convenient. Also is it possible to schedule robocopy and have it execute in a bat file to be run on-demand? Or is there a better solution?

The servers are Windows 2003/2008.

share|improve this question
1  
Do you actually need it to "sync" i.e. someone could make changes on ANY server and the rest will receive updates, or do you just need it copied from a specific server to the others. –  SpacemanSpiff Sep 2 '11 at 14:00
    
You should be able to. And yes you should be able to schedule it. Have you tried it? I know with Windows 7 you need to escalate the privlages because c:\windows\system32\drivers\etc is protected. –  Nixphoe Sep 2 '11 at 14:01
    
@SpacemanSpiff: I guess sync'ed was used in the wrong context. We just need it copied over from one specific server to others. –  hsatterwhite Sep 2 '11 at 14:03
    
@Nixphone I have not yet had a chance to try it. I presumed there would be some catch to copying host files over, which is why I'm here asking the experts. :) –  hsatterwhite Sep 2 '11 at 14:04
    
What is wrong with DNS? –  84104 Sep 2 '11 at 17:12

1 Answer 1

up vote 2 down vote accepted

I would suggest using a DNS server instead of distributing a HOST file. However, if you must; yes, one-to-one is what robocopy is good at; there are much more efficient replication methods that would be much better: DFS-R, FRS, and rsync to name a few.

To save a robocopy job, you could opt to use the /save: argument, then the /job argument to recall the job that was saved.

I would, however, suggest simply writing a BAT, and using a scheduled task.

share|improve this answer
    
Thanks for the answer. Unfortunately we do have to rely on host files here. I wish we could fall back on DNS like you're supposed to. I'll read in to the other solutions mentioned. –  hsatterwhite Sep 2 '11 at 14:15
    
Using HOST files is fine, but can get get complex and annoying to manage in a distributed environment (ex: your situation). –  mbrownnyc Sep 2 '11 at 14:17
    
as mentioned...BAT file with the robocopy command and scheduled task. Use one BAT file on the "source" server to run multiple robocopy lines for each "target" server. Make sure you only update the source server of course. –  TheCleaner Sep 2 '11 at 14:18
    
That's pretty much what I was getting at. –  SpacemanSpiff Sep 2 '11 at 14:22
    
Thanks for the help everyone. I'll give it a shot –  hsatterwhite Sep 2 '11 at 17:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.