- Created by Documentation, last modified on Jan 28, 2019
disable_authentication_provider
disable_failing_authentication_providers
enable_authentication_provider
get_available_authentication_providers
get_provider_client_configurations
get_provider_configuration_fields
get_provider_display_configurations
get_users_authn_linked_accounts
set_provider_client_configurations
set_provider_display_configurations
twofactorauth_generate_tfa_config
twofactorauth_get_user_configs
cpgreylist_is_server_netblock_trusted
cpgreylist_list_entries_for_common_mail_provider
cpgreylist_load_common_mail_providers_config
cpgreylist_save_common_mail_providers_config
cpgreylist_trust_entries_for_common_mail_provider
cpgreylist_untrust_entries_for_common_mail_provider
create_cpgreylist_trusted_host
delete_cpgreylist_trusted_host
Description
This function validates the pointer records (PTR) for IPv4 and IPv6 addresses an account's domains send mail from. It retrieves the PTR records for each IP address and determines which of the domain's IP addresses send mail. It then validates the PTR records for each IP address and validates the A (IPv4) or AAAA (IPv6) records pointing to each domain. This function also ensures that at least one of that domain's A or AAAA records points back to the IP address.
Important:
MailSend
role, the system disables this function. For more information, read our How to Use Server Profiles documentation.Examples
https://hostname.example.com:2087/cpsess##########/json-api/validate_current_ptrs?api.version=1&domain=example.com
whmapi1 validate_current_ptrs domain=example.com
Notes:
- You must URI-encode values.
- For more information and additional output options, read our Guide to WHM API 1 documentation or run the
whmapi1 --help
command. If you run CloudLinux™, you must use the full path of the
whmapi1
command:/usr/local/cpanel/bin/whmapi1
{ "data":{ "payload": [ { "arpa_domain": "1.0.0.10.in-addr.arpa", "domain": "example.com", "helo": "example.com", "state": "VALID", "ip_address": "10.0.0.1", "ip_version": 4, "nameservers": [ "ns1.example.com", "ns2.example.com", "ns3.example.com" ], "ptr_records": [ { "domain": "example.com", "state": "VALID", "forward_records": [ "10.0.0.1" ] } ] }, { "arpa_domain": "3.0.0.10.in-addr.arpa", "domain": "example.com", "helo": "example.com", "state": "PTR_MISMATCH", "ip_address": "10.0.0.3", "ip_version": 4, "nameservers": [ "ns1.example.com", "ns2.example.com", "ns3.example.com" ], "ptr_records": [ { "domain": "example.com", "state": "FWD_MISMATCH", "forward_records": [ "192.168.12.34" ] } ] }, { "arpa_domain": "4.3.3.7.0.7.3.0.e.2.a.8.0.0.0.0.0.0.0.0.3.a.5.8.8.b.d.0.1.0.0.2.ip6.arpa", "domain": "example.com", "helo": "example.com", "state": "VALID", "ip_address": "2001:0db8:85a3:0000:0000:8a2e:0370:7334", "ip_version": 6, "nameservers": [ "ns1.example.com", "ns2.example.com", "ns3.example.com", ], "ptr_records": [ { "domain": "example.com", "state": "VALID", "forward_records": [ "2001:0db8:85a3:0000:0000:8a2e:0370:7334" ] } ] }, { "arpa_domain": "2.0.0.10.in-addr.arpa", "domain": "example.com", "helo": "example.com", "state": "MISSING_PTR", "ip_address": "10.0.0.2", "ip_version": 4, "nameservers": [ "ns1.example.com", "ns2.example.com", "ns3.example.com" ], "ptr_records": [ ] }, { "helo" : "thisothermaildomain.com", "ptr_records" : [], "ip_address" : "1.1.1.1.1", "state" : "ERROR", "error" : "1.1.1.1.1 is not a valid IP address.", "domain" : "thisotheremaildomain.com" }, { "arpa_domain": "4.0.0.10.in-addr.arpa", "domain": "example.com", "helo": "example.com", "state": "PTR_MISMATCH", "ip_address": "10.0.0.4", "ip_version": 4, "nameservers": [ "ns1.example.com", "ns2.example.com", "ns3.example.com", ], "ptr_records": [ { "domain": "example.com", "state": "MISSING_FWD", "forward_records": [ ] } ] } ] }, "metadata":{ "version":1, "command":"validate_current_spfs", "reason":"OK", "result":1 } }
Note:
Parameters
Parameter | Type | Description | Possible values | Example |
---|---|---|---|---|
domain | string | Required The domain for which to validate the PTR records. Note: To query multiple domains, duplicate the parameter. For example, use the | A valid domain. | example.com |
Returns
Return | Type | Description | Possible values | Example |
---|---|---|---|---|
payload | array of hashes | An array that contains information about the account's PTR records. | Each hash contains the Note: The system only returns the | |
| string | The queried domain. This function returns in the | A valid domain. | example.com |
| string | The hostname that the domain uses to identify itself to remote SMTP servers. This function returns in the | A valid hostname. | example.com |
| array of hashes | The domain's PTR records. This function returns in the | Each hash contains the Note: The system does not return this hash for a domain with an invalid IP address. | |
| string | The fully qualified domain name (FQDN) that a PTR record points to. This function returns in the | A valid domain. | example.com |
| string | Whether the domain's PTR record points to a domain with an A (IPv4) or a AAAA (IPv6) record. This function returns in the |
| VALID |
| array of strings | A list of IP addresses that the domain resolves to for A (IPv4) and AAAA (IPv6) records. This function returns in the | A list of valid IP addresses. | 10.0.0.1 |
| string | The IP address used to perform a reverse DNS (rDNS) lookup. For more information about rDNS, read our How to Configure Reverse DNS for BIND in WHM documentation. This function returns in the | A valid reversed IP address appended with one of the following:
For information about Note: The system does not return this value for a domain with an invalid IP address. | 1.0.0.10.in-addr.arpa |
| integer | The IP version number. This function returns in the |
Note: The system does not return this value for a domain with an invalid IP address.
| 4 |
| string | The IP address. This function returns in the | A valid IP address. Note: The system does not return this value for a domain with an invalid IP address. | 10.0.0.1 |
| array of strings | The authoritative nameservers for the domain's PTR record. This function returns in the | A list of valid nameservers. | ns1.example.com |
| string | Whether the PTR records are valid for the domain. This function returns in the |
| VALID |
| string | The reason why the system did not validate the domain's IP address. This function returns in the | A valid error message. Note: The system only returns this value when an invalid IP address exists for the domain in the | 1.1.1.1.1 is not a valid IP address. |
Function information
API Version:
Available in:
WHM 78+
Methods:
GET, POST
Required Parameters:
domain
Return Formats:
JSON
About WHM API 1
WHM API 1 performs functions and accesses data in WHM.
Notes:
- Some functions and parameters may require that you authenticate as the
root
user. - You must use the appropriate WHM ports (
2086
or2087
) to call WHM API functions.
Find a function
Related functions
-
Page:WHM API 1 Sections - Addon Domains — Addon Domain functions allow you to manage addon domains or convert them to full cPanel accounts.
-
Page:WHM API 1 Functions - convert_addon_fetch_conversion_details — This function returns the details of the convert addon domain to account process.
-
Page:WHM API 1 Functions - convert_addon_fetch_domain_details — This function retrieves domain data for an addon domain.
-
Page:WHM API 1 Functions - convert_addon_get_conversion_status — This function returns the status of the convert addon domain to account process for specified conversion jobs.
-
Page:WHM API 1 Functions - convert_addon_initiate_conversion — This function initiates the conversion process for an addon domain.