ARD command to edit etc/hosts

jeno

Registered
Dear All,

May I know what is the unix command that I can use in ARD to add a record to the etc/hosts file?

For example, I need to add an extra line to the hosts file:
172.17.x.x Prodserve1

I've try networksetup -setsearchdomains but not working


Thanks & Regards,
Jeno
 
The easiest way I have found is to modify the /etc/hosts file on your ARD system. Then use Automater to find that file on your system and copy it to the top level of the drive on your target system.

Then use the rm command to remove the existing files and cp to copy the new files from the top level of the drive to /etc as root to give them the correct permissions.

I hope this all makes sense. Once you have created this Automater action you can use it any time you need to change the file in the future, with the added bonus you can do it on multiple machines at the same time. Always assuming they use the same hosts file.
 
After struggling for few hours, I came out with a method which is similar to yours but a lot easier.

I just edit the hosts file and copy it to my desktop. Replace the hosts file on every machine with the new hosts file that sit on my desktop using ARD.

Cheers,
Jeno
 
Back
Top