PHPackages                             codem/silverstripe-domain-validation - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. codem/silverstripe-domain-validation

ActiveSilverstripe-vendormodule[Validation &amp; Sanitization](/categories/validation)

codem/silverstripe-domain-validation
====================================

A set of fields, including editable userform fields to perform domain validation via DNS over HTTPS

v0.2(7y ago)11051BSD-3PHP

Since Aug 27Pushed 5y ago1 watchersCompare

[ Source](https://github.com/codem/silverstripe-domain-validation)[ Packagist](https://packagist.org/packages/codem/silverstripe-domain-validation)[ RSS](/packages/codem-silverstripe-domain-validation/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (2)Dependencies (7)Versions (5)Used By (0)

Domain Validation module for Silverstripe
=========================================

[](#domain-validation-module-for-silverstripe)

This module provides a set of fields to allow domain lookup via DNS over HTTPS services.

- Validated Email Field - validates the domain part of a provided email address via MX lookup
- Validated Domain Field - validates any domain via the configured record type (default: A)
- Selectable Lookup Field - validates any domain via multiple, selectable record types

Some APIs reject requests if a domain or domain part is invalid e.g user@examplecom or user@hotmailcom With this module you can check values using DoH prior to submitting or saving them.

Requirements
------------

[](#requirements)

Silverstripe 4 / see composer.json

Features
--------

[](#features)

- Plugs into Cloudflare DNS over HTTPS
- Plugs into Google Public DNS over HTTPS
- Does Caching based on TTL (Flysystem middleware)
- Provides a Validatable Email Form Field (MX record check on domain part) for use in forms
- Provides a Validatable Domain Form Field (A record check on domain)
- Provides a Form Field for selecting which DNS records to check against a domain
- Provides EditableFormFields for the `silverstripe/userforms` module

### Basic MX Validation

[](#basic-mx-validation)

```
use Codem\DomainValidation\CloudflareDnsOverHttps;
...
$domain = "google.com"
$service = new CloudflareDnsOverHttps();
$service->setDomain($domain);
$answers = $service->performLookup('MX');
//OR shortcut
$service->hasMxRecord();
//OR compare priority and hostname exactly
$service->hasMxRecord('1 some.host');

```

### Basic A + AAAA Validation

[](#basic-a--aaaa-validation)

```
use Codem\DomainValidation\CloudflareDnsOverHttps;
...
$domain = "google.com"
$service = new CloudflareDnsOverHttps();
$service->setDomain($domain);
$results = [];
$results['AAAA'] = $service->performLookup('AAAA');
$results['A']= $service->performLookup('A');

```

### Form field usage

[](#form-field-usage)

See DomainValidationForm in the source for a full example

### UserForm field

[](#userform-field)

Editable form fields are available for the silverstripe/userforms module

The `EditableSelectableLookupField` field allows for DnsChecks to be configured along with strict checking. The `ValidatedDomainField` allows for configurable record type and strict/non-strict checking.

- Strict Checking - the lookup must return entries for each record type requested
- Non Strict Checking - the lookup can return any number of entries for the field to validate as OK

Install
-------

[](#install)

```
/path/to/php /path/to/composer require codem/silverstripe-domain-validation:^n.N

```

This is a pre-release, not currently in Packagist.

Author
======

[](#author)

Codem

License
-------

[](#license)

See LICENCE

###  Health Score

27

—

LowBetter than 46% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~174 days

Total

2

Last Release

2714d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a2d750925f6ceec945734b91d36484bb4e6b026039771d9d9651e3c9fb79fa1c?d=identicon)[codemau](/maintainers/codemau)

---

Top Contributors

[![JamesDPC](https://avatars.githubusercontent.com/u/69664712?v=4)](https://github.com/JamesDPC "JamesDPC (22 commits)")

---

Tags

dnsdohlookupvalidationsilverstripednsdomain

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/codem-silverstripe-domain-validation/health.svg)

```
[![Health](https://phpackages.com/badges/codem-silverstripe-domain-validation/health.svg)](https://phpackages.com/packages/codem-silverstripe-domain-validation)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.2k555.0M2.8k](/packages/aws-aws-sdk-php)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

353.6k](/packages/eslazarev-wildberries-sdk)[silverstripe/userforms

UserForms enables CMS users to create dynamic forms via a drag and drop interface and without getting involved in any PHP code

1321.1M94](/packages/silverstripe-userforms)[dnadesign/silverstripe-elemental

Elemental pagetype and collection of Elements

1101.1M340](/packages/dnadesign-silverstripe-elemental)[symbiote/silverstripe-advancedworkflow

Adds configurable workflow support to the CMS, with a GUI for creating custom workflow definitions.

46304.8k9](/packages/symbiote-silverstripe-advancedworkflow)[sheadawson/silverstripe-zenvalidator

Faster, easier client and server-side form validation for SilverStripe

5782.6k2](/packages/sheadawson-silverstripe-zenvalidator)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
