instructions for using dnspinger
Before deploying dnsPinger, you will want to create an App Insights workspace.
In this package, you will find a file named env.vars. This file contains a list of environment variables that will be passed to the container:
DNSPINGER_CUSTOM_DIMENSIONS=NodePool=mylaptop;env=local
DNSPINGER_DOMAINS=www.google.com;homedepot.aprimo.com;api.videoindexer.ai
DNSPINGER_REGION=us1
DNSPINGER_RESOLVERS=google=8.8.8.8;opendns=208.67.222.222;azure=168.63.129.16
APPINSIGHTS_INSTRUMENTATIONKEY=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
The following section will explain these environment variables and their usage:
- DNSPINGER_CUSTOM_DIMENSIONS: A list of semi-colon (;) delimited key-value pairs. In addition to the other environment variables, these are passed to the Log Analytics
customEventstable as customDimensions. The idea here was to include the name of the nodepool where this application is running and any other pertinent information. - DNSPINGER_DOMAINS: A semi-colon (;) delimited list of domains to resolve.
- DNSPINGER_REGION: The region where the application is running. We implemented this because (as stated on our call), we are running AKS in 3 regions (Australia East, East US, and West Europe)
- DNSPINGER_RESOLVERS: A list of semi-colon (;) delimited key-value pairs. The key is the name of a resolver (this is just an arbitrary string used for identification) and the value is the IP address of the resolver
- APPINSIGHTS_INSTRUMENTATIONKEY: The App Insights instrumentation key where the logs can be uploaded to
You can also view logs by tailing the pod:
Found domain to resolve: www.google.com
[google] Resolving www.google.com: 142.250.190.36
[opendns] Resolving www.google.com: 142.250.191.196
[DotnetResolver] Resolving www.google.com: 172.253.62.103,172.253.62.147,172.253.62.99,172.253.62.104,172.253.62.105,172.253.62.106
[DefaultResolver] Resolving www.google.com: 172.253.62.103,172.253.62.147,172.253.62.99,172.253.62.104,172.253.62.105,172.253.62.106
Found domain to resolve: homedepot.aprimo.com
[google] Resolving homedepot.aprimo.com: 52.255.216.147
[opendns] Resolving homedepot.aprimo.com: 52.255.216.147
[DotnetResolver] Resolving homedepot.aprimo.com: 52.255.216.147
[DefaultResolver] Resolving homedepot.aprimo.com: 52.255.216.147
Found domain to resolve: api.videoindexer.ai
[google] Resolving api.videoindexer.ai: 52.162.125.85
[opendns] Resolving api.videoindexer.ai: 52.162.125.85
[DotnetResolver] Resolving api.videoindexer.ai: 168.62.50.75
[DefaultResolver] Resolving api.videoindexer.ai: 168.62.50.75
Found domain to resolve: www.microsoft.com
[google] Resolving www.microsoft.com: 184.84.226.4
[opendns] Resolving www.microsoft.com: 23.78.9.173
[DotnetResolver] Resolving www.microsoft.com: 104.72.157.175
[DefaultResolver] Resolving www.microsoft.com: 104.72.157.175
[MessagesSent] 0
[MessagesReceived] 0
[ErrorsSent] 0
[ErrorsReceived] 0
[EchoRequestsSent] 0
[EchoRequestsReceived] 0
[EchoRepliesSent] 0
[EchoRepliesReceived] 0
[DestinationUnreachableMessagesSent] 0
[DestinationUnreachableMessagesReceived] 0
[SourceQuenchesSent] 0
[SourceQuenchesReceived] 0
[RedirectsSent] 0
[RedirectsReceived] 0
[TimeExceededMessagesSent] 0
[TimeExceededMessagesReceived] 0
[ParameterProblemsSent] 0
[ParameterProblemsReceived] 0
[TimestampRequestsSent] 0
[TimestampRequestsReceived] 0
[TimestampRepliesSent] 0
[TimestampRepliesReceived] 0
[AddressMaskRequestsSent] 0
[AddressMaskRequestsReceived] 0
[AddressMaskRepliesSent] 0
[AddressMaskRepliesReceived] 0
You will also see some network statistics in the logs.
To run locally:
docker run --env-file ./env.vars rnemethaprimo/dnspinger@latest
To run in Kubernetes: Use the attached deployment.yaml (be sure to update the env vars accordingly)
Some simple LA queries to get you started:
# get all failed queries in the last 10 minutes:
let t = 10m;
customEvents
| where timestamp > ago(t)
| where customDimensions.Success == false
# get log entries for a resolver
customEvents
| where customDimensions.Resolver == "azure"