A set of fields, including editable userform fields to perform domain validation via DNS over HTTPS
This module provides a set of fields to allow domain lookup via DNS over HTTPS services.
Some APIs reject requests if a domain or domain part is invalid e.g [email protected] or [email protected]
With this module you can check values using DoH prior to submitting or saving them.
Silverstripe 4 / see composer.json
silverstripe/userforms
moduleuse 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');
use Codem\DomainValidation\CloudflareDnsOverHttps;
...
$domain = "google.com"
$service = new CloudflareDnsOverHttps();
$service->setDomain($domain);
$results = [];
$results['AAAA'] = $service->performLookup('AAAA');
$results['A']= $service->performLookup('A');
See DomainValidationForm in the source for a full example
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.
/path/to/php /path/to/composer require codem/silverstripe-domain-validation:^n.N
This is a pre-release, not currently in Packagist.
Codem
See LICENCE
Module rating system helping users find modules that are well supported. For more on how the rating system works visit Module standards
Score not correct? Let us know there is a problem