It can create duplicate names with 'And because it's a public domain PowerShell script instead of a licensed binary, it's easy to customize without any legal worries.
The script can take multiple local, SMB or HTTP paths to multiple input files to create one new HOSTS file with redundant names removed. Note: Why is this script any different than other HOSTS file tools out there? The script puts nine names on each line of the file, which optimizes lookup performance greatly. This is a script we use in the Securing Windows and PowerShell Automation course ( SEC505) at SANS conferences.ĭownload the Update-HostsFile.ps1 script from in the SEC505 zip file (look under \ Day4\DNS). You can run the script manually, as a scheduled job, or push it out through Group Policy for enterprise-wide deployment. This article shows you how to use a free PowerShell script to block bad domain names by modifying the HOSTS file on Windows computers.