Skip to main content

Worklet for Hosts File


Forum|alt.badge.img

Hi all,


Has anyone used Automox to update or push out a hosts file?


Thank you,

Chris.

4 replies

Forum|alt.badge.img
  • Power User
  • 52 replies
  • January 4, 2021

Haven’t done that before, but I have done that using a logon script. Wait, are you very sure you want to go down this path?


Nic-Automox
  • Former Automox Employee
  • 832 replies
  • January 4, 2021

We do have some worklets to put files in a directory, so you could make use of one of those but I second @jesumyip in asking if you really want to be tinkering with hosts files 🙂



Forum|alt.badge.img
  • Author
  • Novice
  • 14 replies
  • January 5, 2021

Absolutely.


I want to be able to update a hosts file on a remote endpoint, using the fastest methodology I have, which is Automox.


The challenge I have, is DNS. (Isn’t it always.)

We use Cisco Umbrella, which has some oddities when it comes to Trusted Forests.

In order to (in the short term) reduce the visible impact to a small selection of internal customers, I need to set DNS entries, locally, which the most easiest and consistent way is using the hosts file.


Forum|alt.badge.img
  • Power User
  • 52 replies
  • January 5, 2021

It’s not difficult. If you are overwriting your HOSTS file, just upload a copy of it to your worklet then reference it in the powershell by name and use the file copy cmdlet. For example:


Move-Item “mynewhostsfile.txt” C:\Windows\System32\Drivers\etc\hosts -Force -ErrorAction SilentlyContinue


This is assuming you uploaded your host file as “mynewhostsfile.txt”.


The worklet posted by @Nic is a good place to start.


Could you not create a secondary DNS zone or DNS server and put those entries there instead? Just exploring ideas.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings