The Problem with LLM-Based Diagnosis

Ask a large language model (LLM) why email to your domain is bouncing, and you might receive a comprehensive, yet generic, list of potential causes. This is akin to a doctor diagnosing a patient based solely on textbook symptoms without ever examining them. The LLM possesses vast knowledge but lacks the crucial ability to interact with the real world – in this case, the network. An experienced engineer, by contrast, doesn't rely solely on abstract knowledge. They actively use tools like dig, observe the results, and let the evidence guide their subsequent diagnostic steps. This hands-on, evidence-driven approach is the core difference, and it's the capability now being brought to an AI agent.

Introducing DNS Detective

DNS Detective is a novel agent designed to bridge this gap. It grants an AI the ability to "touch the network." Built as a small agent running on DigitalOcean Serverless Inference, DNS Detective tackles complex issues related to DNS, TLS, and email records. Unlike LLMs that hallucinate or provide theoretical answers, DNS Detective performs actual network probes. It systematically resolves records, establishes TLS handshakes, pulls registration data, and fetches URLs. This iterative process of probing, reading, and probing again allows it to generate diagnoses grounded in concrete, observable data. Every assertion made by DNS Detective is directly traceable to a specific lookup it performed.

The agent's architecture is deliberately lean, comprising approximately 300 lines of Python code. This simplicity facilitates understanding, modification, and deployment. The core innovation lies in its operational methodology: it doesn't just process information; it actively gathers it through direct interaction with the network infrastructure. This makes its diagnostic capabilities far more robust and reliable than purely knowledge-based AI approaches.

How DNS Detective Works: A Probing Loop

The operational loop of DNS Detective is central to its effectiveness. It begins with an initial query or a suspected problem area. Based on this, the agent selects and executes a relevant network probe. This could involve querying DNS servers for MX, A, or TXT records, attempting a TLS connection to a mail server or web server, or even performing an HTTP GET request to a domain's web presence.

The results of these probes are then analyzed. If the results are inconclusive or suggest further investigation, DNS Detective formulates new queries. For instance, if an MX record lookup returns an unexpected IP address, the agent might then initiate a connection to that IP to check for open ports or banner information. If a TLS handshake fails, it might attempt to fetch the certificate and analyze its details. This intelligent, adaptive probing creates a diagnostic pathway that mimics the thought process of a seasoned network engineer.

Diagram illustrating the iterative probing loop of DNS Detective

Real-World Diagnoses: Three Case Studies

The effectiveness of DNS Detective is best illustrated through real-world examples. The developers recorded three distinct diagnostic sessions to showcase its capabilities.

Case 1: Mail Bounce Diagnosis

A user reported intermittent mail bounces for their domain. A typical LLM might suggest issues with spam filters, incorrect sender addresses, or full mailboxes. DNS Detective, however, began by querying the domain's MX records. It discovered that one of the listed MX servers was unresponsive, while another pointed to an IP address associated with a known spam blocklist. The agent then attempted to connect to the mail server via SMTP on port 25. The probe revealed that the server was actively rejecting connections from certain IP ranges, confirming the blocklist issue as the primary cause of bounces, not a theoretical problem but a concrete network state.

Case 2: TLS Certificate Expiry

A website hosted on a custom domain began showing browser security warnings. The problem was identified as a potential TLS/SSL certificate issue. DNS Detective initiated a TLS handshake with the domain's web server. The probe immediately returned a certificate validation error. The agent then fetched the certificate details, revealing that it had expired three days prior. It also checked the domain's registration data to ensure the domain itself was active, ruling out domain expiry as a cause. The diagnosis was precise: an expired TLS certificate, directly observed through a failed handshake and certificate inspection.

Case 3: Subdomain Resolution Failure

A user found that a critical subdomain was not resolving correctly, impacting internal services. An LLM might suggest DNS propagation delays or incorrect record propagation. DNS Detective first queried the authoritative DNS server for the subdomain's A record. The probe confirmed that the record was correctly configured on the authoritative server. It then performed a recursive lookup from multiple public DNS resolvers. This revealed that some resolvers had stale cache entries, while others were correctly resolving to the new IP address. The diagnosis pinpointed inconsistent DNS propagation across different resolvers as the issue, not a definitive record error, but a caching and distribution problem.

Technical Underpinnings and Deployment

DNS Detective leverages Python for its core logic, making it accessible and easy to modify. The choice of DigitalOcean Serverless Inference for deployment is strategic. Serverless functions offer scalability, cost-efficiency, and reduce the operational overhead of managing dedicated infrastructure. This allows the agent to perform probes on demand without requiring a constantly running server, making it an economical solution for intermittent diagnostic needs.

The agent's design prioritizes verifiable results. By citing the exact lookups performed, users can independently verify the findings. This transparency builds trust and allows for more effective troubleshooting. It moves away from the "black box" nature of some AI tools, offering a clear audit trail of its diagnostic process.

The Future of Network Diagnostics

DNS Detective represents a significant step towards more capable and reliable AI-driven network diagnostics. By combining the broad knowledge base of LLMs with the concrete, evidence-gathering capabilities of network probing tools, it offers a powerful new approach. This agent is not just an LLM with network access; it's a system designed to mimic and enhance the methodology of expert network engineers.

The implications extend beyond simple troubleshooting. Such agents could be integrated into CI/CD pipelines to automatically check DNS and TLS configurations before deployment, or used by hosting providers to proactively monitor customer domains. The ability to perform verifiable, network-aware diagnostics opens up new possibilities for automated network management and security.

What remains to be seen is how broadly this paradigm of "probing AI" will be adopted. Will other AI diagnostic tools follow suit, or will this remain a niche innovation? The success of DNS Detective suggests a compelling direction for future AI development: one that prioritizes interaction with the real world over passive knowledge recall.