Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Dns Laravel Package

spatie/dns

Fetch DNS records in PHP using dig. Query domains for A, AAAA, CNAME, MX, TXT, SRV and more, filter by type(s), and get structured record objects with handy accessors for record details.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • DNS-based validation & security features: Enable domain ownership verification (e.g., for SPF, DKIM, DMARC records) or phishing protection by programmatically checking DNS configurations.
  • Infrastructure monitoring: Build automated checks for DNS record consistency (e.g., A/AAAA records, MX records) across environments (dev/staging/prod) to catch misconfigurations early.
  • Dynamic DNS resolution: Power features like geo-routing, failover systems, or load balancing by fetching real-time DNS records (e.g., SRV, CNAME).
  • Compliance & auditing: Automate audits of DNS records (e.g., TXT for security policies, CAA for certificate authority restrictions) to meet regulatory requirements.
  • Build vs. buy: Avoid reinventing DNS parsing logic (e.g., regex, CLI calls) and leverage a maintained, battle-tested package with support for 12+ record types.
  • Roadmap: Foundation for future features like:
    • DNSSEC validation.
    • Integration with CI/CD pipelines (e.g., fail builds if DNS misconfigurations exist).
    • Custom DNS handlers for internal systems (e.g., private DNS zones).

When to Consider This Package

  • Adopt if:

    • Your app needs to programmatically query DNS records (e.g., Laravel, Symfony, or custom PHP apps).
    • You require reliability (supports dig fallback to dns_get_record() if dig is unavailable).
    • You need extensibility (custom handlers, retries, timeouts).
    • Your team lacks DNS expertise but needs structured access to records (e.g., A, MX, TXT).
    • You’re using PHP 8.0+ (package dropped PHP 7.x support in v2.0).
  • Look elsewhere if:

    • You need real-time DNS updates (this package queries, not modifies, DNS).
    • Your stack is non-PHP (e.g., Python, Go—use native libraries like dns.resolver).
    • You require DNS-over-HTTPS (DoH) or DNS-over-TLS (DoT) (this uses dig or dns_get_record()).
    • You need bulk DNS analysis (consider specialized tools like dnsenum or massdns).
    • Your environment blocks dig (e.g., restricted servers; fallback to dns_get_record() may suffice).

How to Pitch It (Stakeholders)

For Executives: *"This package lets us automate DNS validation and monitoring without building custom parsers. For example, we can:

  • Prevent phishing by verifying SPF/DKIM records before email delivery.
  • Catch misconfigurations in CI/CD (e.g., broken A records in staging).
  • Enable dynamic routing by querying DNS in real-time. It’s low-risk (MIT-licensed, used by 600+ repos) and saves dev time by handling edge cases like retries and timeouts."*

For Engineers: *"Spatie’s dns package gives us:

  • Simple API: Fetch records in one line ($dns->getRecords('example.com', 'MX')).
  • Flexibility: Custom nameservers, retries, and handlers (e.g., swap dig for a custom resolver).
  • Maintenance: Actively updated (last release: June 2026), supports PHP 8.0–8.2, and Symfony 7/8.
  • Extensible: Add methods to records via macros or build custom handlers. Tradeoff: Requires dig (fallback to dns_get_record() if unavailable)."*
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
ecotone/kafka
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata