This is a simple web-based troubleshooting tool for querying DNS environments to view the IP address that a domain name ultimately resolves to. The code behind this was mainly written to troubleshoot where cached records needed to be purged after IP changes.
At this point, it's intentionally been designed to not show a high level of detail such as the type of record, etc.
Additional options that can be dispalyed for each query:
- Record TTL
- Query Reponse Time
By default, queries will be sent to Cloudflare Google and if no name servers are specified. You can find instructions for setting up your own name servers here.
You can specify your own set of servers to query by adding a file named servers.yml and mapping it to /app/servers.yml within the container. The contents must be in this format:
dnsquery:
Name Server 1 - Cloudflare:
ip: 1.1.1.1Name Server 2 - Google:
ip: 8.8.8.8Example docker-compose.yml file
services:
dnsquery:
container_name: dnsquery# Using 'latest' as an example. specifying a specific version is preferredimage: ghcr.io/clayoster/dnsquery:latestrestart: always# This is required if you want to specify your own name servers to queryvolumes:
- ./servers.yml:/app/servers.yml:roports:
- "8080:8080"Example Kubernetes manifest file defining the following items:
- Namespace
- ConfigMap (Containing servers.yml file containing example configuration)
- Deployment (A single pod with health checks)
- Service
- Ingress (Configured for nginx ingress with example domain "dnsquery.example.com" with HTTPS optionally)
---
apiVersion: v1kind: Namespacemetadata:
name: dnsquery
---
apiVersion: v1kind: ConfigMapmetadata:
name: dnsquerynamespace: dnsquerydata:
servers.yml: | # Example Configuration # # dnsquery: # Example - CloudFlare - 1.1.1.1: # ip: '1.1.1.1' # Example - Google DNS - 8.8.8.8: # ip: '8.8.8.8'---
apiVersion: apps/v1kind: Deploymentmetadata:
name: dnsquerynamespace: dnsquerylabels:
app: dnsqueryspec:
replicas: 1selector:
matchLabels:
app: dnsquerytemplate:
metadata:
labels:
app: dnsqueryspec:
containers:
- name: dnsqueryimage: ghcr.io/clayoster/dnsquery:latestports:
- containerPort: 8080name: 8080tcpprotocol: TCPresources: {}livenessProbe:
httpGet:
path: /healthport: 8080scheme: HTTPinitialDelaySeconds: 5periodSeconds: 10successThreshold: 1timeoutSeconds: 3failureThreshold: 3volumeMounts:
- mountPath: /app/servers.ymlname: dnsqueryreadOnly: truesubPath: servers.ymlvolumes:
- name: dnsqueryconfigMap:
name: dnsquery
---
apiVersion: v1kind: Servicemetadata:
name: dnsquerynamespace: dnsqueryspec:
selector:
app: dnsqueryports:
- protocol: TCPport: 80targetPort: 8080type: ClusterIP
---
apiVersion: networking.k8s.io/v1kind: Ingressmetadata:
name: dnsquerynamespace: dnsqueryspec:
ingressClassName: nginxrules:
- host: dnsquery.example.comhttp:
paths:
- path: /pathType: Prefixbackend:
service:
name: dnsqueryport:
number: 80# Optional TLS block#tls:# - hosts:# - dnsquery.example.com# secretName: tls-cert-name- Add option to find Active Directory DNS servers based on AD SRV records and query them
- Add test for DNS timeout handling (test the perform_query function directly)