Useful Scripts

Article author
Liam Blake
  • Updated

# Windows #

Uninstallation Scripts

PowerShell

MSP Version (DNS Agent)

$Prod = Get-WMIObject -Classname Win32_Product | Where-Object Name -Match 'DNS Agent'
$Prod.UnInstall()

Standard Version (DNSFilter Agent)

$Prod = Get-WMIObject -Classname Win32_Product | Where-Object Name -Match 'DNSFilter Agent'
$Prod.UnInstall()

Command Line

MSP Version (DNS Agent)

wmic product where name="DNS Agent" call uninstall

Standard Version (DNSFilter Agent)

wmic product where name="DNSFilter Agent" call uninstall

Installation Scripts

PowerShell

MSP Version (DNS Agent)

mkdir C:\temp
Invoke-WebRequest -Uri "https://download.dnsfilter.com/User_Agent/Windows/DNS_Agent_Setup.msi" -OutFile "C:\temp\DNS_Agent_Setup.msi"
msiexec /qn /i "C:\temp\DNS_Agent_Setup.msi" NKEY="SITESECRETKEY"

Official Signed Uninstall / Reinstall DNS Agent script

See attached media: Link

Standard Version (DNSFilter Agent)

mkdir C:\temp
Invoke-WebRequest -Uri "https://download.dnsfilter.com/User_Agent/Windows/DNSFilter_Agent_Setup.msi" -OutFile "C:\temp\DNSFilter_Agent_Setup.msi"
msiexec /qn /i "C:\temp\DNSFilter_Agent_Setup.msi" NKEY="SITESECRETKEY"

Command Line

MSP Version (DNS Agent)

msiexec /qn /i "C:\path\to\DNS_Agent_Setup.msi" NKEY="SITESECRETKEY"

Standard Version (DNSFilter Agent)

msiexec /qn /i "C:\path\to\DNSFilter_Agent_Setup.msi" NKEY="SITESECRETKEY"

Check if the service is running

MSP Version (DNS Agent)

SC QUERY "DNS Agent"

Standard Version (DNSFilter Agent)

SC QUERY "DNSFilter Agent"

Start/Stop service 

MSP Version (DNS Agent)

SC START "DNS Agent"
SC STOP "DNS Agent"

Standard Version (DNSFilter Agent)

SC START "DNSFilter Agent"
SC STOP "DNSFilter Agent"

VPN

In this example we have used a PANGP adapter, this could be any form of adapter you would just have to edit the PANGP value. This script picks up the interface value automatically.

$interfaceName = get-wmiobject win32_networkadapter | Select-Object netconnectionid, name | Where-Object { ($_.name -like 'PANGP*') } | Select-Object -ExpandProperty netconnectionid

$path = 'HKLM:\SOFTWARE\DNSFilter\Agent'

Set-ItemProperty -Path $path -Name 'IgnoreVpnInterfacesNames' -Value $interfaceName

Set-ItemProperty -Path $path -Name 'IgnoreVpnInterfaces' -Value 'true'

Restart-Service -Name 'DNSFilter Agent'

Port Binding

netstat -ban | findstr :53

DoT

MSP Version (DNS Agent)

reg add "HKLM\Software\DNSAgent\Agent" /v UpstreamOrder /d "tcp-tls,udp,tcp" /f

Standard Version (DNSFilter Agent)

reg add "HKLM\Software\DNSFilter\Agent" /v UpstreamOrder /d "tcp-tls,udp,tcp" /f

# macOS #

Uninstallation Scripts

MSP Version (DNS Agent)

sudo sh /Applications/DNS\ Agent.app/Contents/Resources/uninstall.sh
or
yes | sudo sh "/Applications/DNS Agent.app/Contents/Resources/uninstall.sh"

Standard Version (DNSFilter Agent)

sudo sh /Applications/DNSFilter\ Agent.app/Contents/Resources/uninstall.sh
or
yes | sudo sh "/Applications/DNSFilter Agent.app/Contents/Resources/uninstall.sh"

Installation Scripts

MSP Version (DNS Agent)

#!/bin/bash
curl https://download.dnsfilter.com/User_Agent/MacOS/DNS%20Agent-Installer.pkg -o /tmp/DNS%20Agent-Installer.pkg
cd /tmp
echo "your site key here" > dns_agent_site_key && sudo installer -dumplog -store -pkg DNS%20Agent-Installer.pkg -target /

Standard Version (DNSFilter Agent)

#!/bin/bash
curl https://download.dnsfilter.com/User_Agent/MacOS/DNSFilter%20Agent-Installer.pkg -o /tmp/DNSFilter%20Agent-Installer.pkg
cd /tmp
echo "your site key here" > dns_agent_site_key && sudo installer -dumplog -store -pkg DNSFilter%20Agent-Installer.pkg -target /

Stop/Start Service

MSP Version (DNS Agent)

sudo launchctl unload /Library/LaunchDaemons/ios.netalerts.agent.macos.helper.plist
sudo launchctl load /Library/LaunchDaemons/ios.netalerts.agent.macos.helper.plist

Standard Version (DNSFilter Agent)

sudo launchctl unload /Library/LaunchDaemons/com.dnsfilter.agent.macos.helper.plist
sudo launchctl load /Library/LaunchDaemons/com.dnsfilter.agent.macos.helper.plist

Port Binding

sudo lsof -i -P | grep LISTEN | grep :53

 

 

 

Was this article helpful?

2 out of 2 found this helpful

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.