You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes machines have set alternate DNS servers that resolve domains even when blocked by AGHome. In these and similar cases it can be tedious to check what's wrong.
Proposed Solution
A website within AGHome that has local javascript (eg: dns.resolve()) to check if certain functionality is working (Similar to ag dns overview test).
Checks:
Resolving of some commonly used domains working? (google,bing,etc...)
Blocked domain response working (random blocked domain provided by aghome on page load)
Alternatives Considered
Some kind of app/script for many operating systems that would do these checks.
Additional Information
Example Batch Script
@echoofftitle%date% - %time%@echo ### Testing google.com on Default ###
color a
nslookup google.com
echo.
@echo ### Testing google.com on AdguardHome DNS ###
nslookup google.com 192.168.2.43
nslookup google.com 192.168.2.47
PAUSEecho.
@echo ### Testing myteamspeak.com on Default ###
nslookup myteamspeak.com
echo.
@echo ### Testing myteamspeak.com on AdguardHome DNS ###
nslookup myteamspeak.com 192.168.2.43
nslookup myteamspeak.com 192.168.2.47
echo.
PAUSE
Example C# Program
using System;using System.Collections.Generic;using System.Linq;using System.Net;using System.Net.NetworkInformation;using System.Net.Sockets;using System.Runtime.InteropServices.WindowsRuntime;using System.Text;using System.Threading.Tasks;namespaceDNSTest{internalclassProgram{privatestaticvoidMain(string[]args){
Console.OutputEncoding = Encoding.UTF8;
DisplayDnsAddresses();
Console.ReadKey();
Main(args);}publicstaticvoidDisplayDnsAddresses(){
Console.Write("Enter Domain: ");vardomain= Console.ReadLine();
NetworkInterface[]adapters= NetworkInterface.GetAllNetworkInterfaces();foreach(NetworkInterface adapter in adapters){IPInterfacePropertiesadapterProperties= adapter.GetIPProperties();IPAddressCollectiondnsServers= adapterProperties.DnsAddresses;if(dnsServers.Count >0){
Console.WriteLine("{0} ({1})", adapter.Description, dnsServers.Count);foreach(IPAddress dns in dnsServers){vargetHostByName= DoGetHostByName(domain)?"Y":"N";// "✅" : "❌";varresolved= DoResolve(domain)?"Y":"N";varhostEntry= DoGetHostEntry(domain)?"Y":"N";varisValid= CheckIPValid(dns.ToString())?"Valid":"Invalid";
Console.WriteLine("\t{0}\t\t[{1} {5}] Dns.GetHostByName: {2} Dns.Resolve: {3} Dns.GetHostEntry: {4}", dns, isValid, getHostByName, resolved, hostEntry, dns.AddressFamily);}
Console.WriteLine();}}}publicstaticboolCheckIPValid(stringstrIP){IPAddressresult=null;return!String.IsNullOrEmpty(strIP)&&
IPAddress.TryParse(strIP,out result);}privatestaticboolDoGetHostByName(stringhostName){try{IPHostEntryhostInfo= Dns.GetHostByName(hostName);// Get the IP address list that resolves to the host names contained in the// Alias property.
IPAddress[]address= hostInfo.AddressList;// Get the alias names of the addresses in the IP address list.
String[]alias= hostInfo.Aliases;// Console.WriteLine("Host name : " + hostInfo.HostName);// Console.WriteLine("\nAliases : ");for(intindex=0;index<alias.Length;index++){// Console.WriteLine(alias[index]);}// Console.WriteLine("\nIP address list : ");for(intindex=0;index< address.Length;index++){// Console.WriteLine(address[index]);}returntrue;}catch(SocketExceptione){// Console.WriteLine("SocketException caught!!!");// Console.WriteLine("Source : " + e.Source);// Console.WriteLine("Message : " + e.Message);}catch(ArgumentNullExceptione){// Console.WriteLine("ArgumentNullException caught!!!");// Console.WriteLine("Source : " + e.Source);// Console.WriteLine("Message : " + e.Message);}catch(Exceptione){// Console.WriteLine("Exception caught!!!");// Console.WriteLine("Source : " + e.Source);// Console.WriteLine("Message : " + e.Message);}returnfalse;}privatestaticboolDoResolve(stringhostString){try{IPHostEntryhostInfo= Dns.Resolve(hostString);// Get the IP address list that resolves to the host names contained in the// Alias property.
IPAddress[]address= hostInfo.AddressList;// Get the alias names of the addresses in the IP address list.
String[]alias= hostInfo.Aliases;// Console.WriteLine("Host name : " + hostInfo.HostName);// Console.WriteLine("\nAliases : ");for(intindex=0;index<alias.Length;index++){// Console.WriteLine(alias[index]);}// Console.WriteLine("\nIP Address list :");for(intindex=0;index< address.Length;index++){// Console.WriteLine(address[index]);}returntrue;}catch(SocketExceptione){// Console.WriteLine("SocketException caught!!!");// Console.WriteLine("Source : " + e.Source);// Console.WriteLine("Message : " + e.Message);}catch(ArgumentNullExceptione){// Console.WriteLine("ArgumentNullException caught!!!");// Console.WriteLine("Source : " + e.Source);// Console.WriteLine("Message : " + e.Message);}catch(NullReferenceExceptione){// Console.WriteLine("NullReferenceException caught!!!");// Console.WriteLine("Source : " + e.Source);// Console.WriteLine("Message : " + e.Message);}catch(Exceptione){// Console.WriteLine("Exception caught!!!");// Console.WriteLine("Source : " + e.Source);// Console.WriteLine("Message : " + e.Message);}returnfalse;}publicstaticboolDoGetHostEntry(stringhostname){try{IPHostEntryhost= Dns.GetHostEntry(hostname);// Console.WriteLine($"GetHostEntry({hostname}) returns:");foreach(IPAddress address in host.AddressList){// Console.WriteLine($" {address}");}returntrue;}catch(Exceptione){// Console.WriteLine("Exception caught!!!");// Console.WriteLine("Source : " + e.Source);// Console.WriteLine("Message : " + e.Message);}returnfalse;}}}
The text was updated successfully, but these errors were encountered:
Problem Description
Sometimes machines have set alternate DNS servers that resolve domains even when blocked by AGHome. In these and similar cases it can be tedious to check what's wrong.
Proposed Solution
A website within AGHome that has local javascript (eg: dns.resolve()) to check if certain functionality is working (Similar to ag dns overview test).
Checks:
Alternatives Considered
Some kind of app/script for many operating systems that would do these checks.
Additional Information
Example Batch Script
Example C# Program
The text was updated successfully, but these errors were encountered: