0

i have 60+ plus workstation running ubuntu 14.04 and 16.04

is there any tools or command that can i automatically add edit or delete hosts file in location /etc/hosts

for example:

pc-1 pc-2 pc-3

i want to add to their /etc/hosts for example an ip"1.1.1.1" how can i write it to terminal with just one command or one tools then when i hit enter it automatically adds to the 3 pc's. please help me or any suggestions about it...any help please by this method it can helps me to saves time a lot "process like API's"

because now im using two procedures 1.1 by 1 go to station by station and edits the etc/hosts file... 2.remotely edits 1 by 1 by terminal

please help me....Thank you

  • @Rinzwind ? Don't get what you want to say – derHugo Jul 25 '17 at 15:31
  • 1
    Puppet lets you alter systems that are in your network. That includes editing hosts file and updating their system from your machine. And lots more. – Rinzwind Jul 25 '17 at 16:38
  • 1
    If you need a possible method: create on your machine sub directories matching your network addresse. Example IP 10.0.,2.1 then 'mkdir -p 10/0/2/[1-255]' and then use a script to walk this path to fetch all the hosts. Use 'sed' to alter the files and a second script to upload them. – Rinzwind Jul 25 '17 at 16:43
  • Would that work for you? – Rinzwind Jul 25 '17 at 16:44

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.