Difference between revisions of "WHOIS Servers"

From WHMCS Documentation

m (Customising WHOIS Servers)
 
(12 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<div class="docs-alert-warning">This documentation page applies to a future as yet unpublished version of WHMCS.</div>
+
<div class="docs-alert-info"><i class="fa fa-question-circle"></i> This page describes a feature available in version 7.0 and above</div>
  
 
==What are WHOIS Servers?==
 
==What are WHOIS Servers?==
WHOIS Servers are used to provide availability results for a domain when performing a domain lookup. In some cases, these servers can also return the Contact Details for a domain. WHMCS supports a large number of TLDs, however it is possible that you wish to use one not supported by default. You can add or change any TLD lookup you like by overriding the default file.
 
  
==WHOIS Servers File Location==
+
WHOIS Servers are used to determine the availability of domains.
<source lang="php">
+
 
resources/domains/dist.whois.json //This is the default file included in WHMCS
+
In most cases, WHOIS servers will also return the WHOIS Contact Information for a domain.
resources/domains/whois.json //This is the override file that can be created
+
 
</source>
+
WHMCS supports a large number of TLDs by default. However, if you wish to sell a domain extension not offered by default, you will need to add the WHOIS Server for it.
 +
 
 +
==Customising WHOIS Servers==
 +
 
 +
The WHOIS Server definitions shipped with WHMCS by default can be found in ''/resources/domains/dist.whois.json''. This file should '''not''' be edited.
  
 
<div class="docs-alert-info"><i class="fa fa-question-circle"></i> Prior to WHMCS 7.0, this file was located at ''/includes/whoisservers.php'' in a different format</div>
 
<div class="docs-alert-info"><i class="fa fa-question-circle"></i> Prior to WHMCS 7.0, this file was located at ''/includes/whoisservers.php'' in a different format</div>
  
==Overriding WHOIS Servers==
+
To add or edit whois server definitions, begin by creating a custom whois.json file located at ''/resources/domains/whois.json''
The default WHOIS Servers file should '''not''' be edited. Instead, use an override file in the same directory named whois.json - '''the override file does not exist by default and may need to be created'''.
 
WHMCS will load the default file first, then the override file to ensure any customisations made are used when performing a lookup.
 
  
===Where can I find other WHOIS Servers?===
+
Inside it, define the whois servers you wish to add or modify only. This file will remain in place when updating WHMCS.
An extensive list of whois servers can be found at [https://www.iana.org/domains/root/db IANA], if it not listed you will need to contact the registry to find out the appropriate information.
+
 
 +
Below is a sample custom whois.json file defining the whois servers for ''.myextension'' and ''.myextension.com'', and overriding the default whois server for ''.org''
  
 
===Sample whois.json Override File===
 
===Sample whois.json Override File===
Line 24: Line 26:
 
     {
 
     {
 
         "extensions": ".myextension,.myextension.com",
 
         "extensions": ".myextension,.myextension.com",
         "server": "whois.myextension.net",
+
         "uri": "socket://whois.myextension.net",
 
         "available": "No match for"
 
         "available": "No match for"
 
     },
 
     },
 
     {
 
     {
 
         "extensions": ".org",
 
         "extensions": ".org",
         "server": "whois.my-org-whois.net:96",
+
         "uri": "socket://whois.my-org-whois.net:96",
 
         "available": "NOT FOUND"
 
         "available": "NOT FOUND"
     },
+
     }
 
]
 
]
 
</source>
 
</source>
  
A WHOIS Server entry is made up of three items.
+
A WHOIS Server definition is made up of four parts.
* '''extensions''' - This is a comma separated list of extensions that this WHOIS server will be used for. In the above example there are two whois servers defined, but three extensions.
 
* '''server''' - This is the server that will be connected to. If the server starts with http://, then a HTTP lookup will be completed. A port for the server can be provided using :port on this field.
 
* '''available''' - This is the [[Glossary#String|string]] that WHMCS will search for when doing a lookup. Not finding this string will mean that the domain shows as unavailable or already registered.
 
  
The sample file shows that while it is possible to add custom extensions (in this case .myextension and .myextension.com), it is also possible to override the default WHOIS Server for an extension.
+
* '''extensions''' - A comma separated list of extensions that this WHOIS server will be used for. In the above example there are two whois servers defined, but three extensions for which lookups are defined.
 +
* '''uri''' - This is the server that will be connected to. A whois based server should begin with ''socket://'' and a web based request should begin with ''http://'' or ''https://'' A port for the server can be provided using :port on this field.
 +
* '''available''' - This is the [[Glossary#String|string]] that WHMCS will match against to determine an available domain. This string must only appear in the output when the domain is available.
 +
 
 +
==Where can I find other WHOIS Servers?==
 +
 
 +
An extensive list of whois servers can be found at [https://www.iana.org/domains/root/db IANA], if it not listed you will need to contact the registry to find out the appropriate information.

Latest revision as of 14:04, 22 September 2020

This page describes a feature available in version 7.0 and above

What are WHOIS Servers?

WHOIS Servers are used to determine the availability of domains.

In most cases, WHOIS servers will also return the WHOIS Contact Information for a domain.

WHMCS supports a large number of TLDs by default. However, if you wish to sell a domain extension not offered by default, you will need to add the WHOIS Server for it.

Customising WHOIS Servers

The WHOIS Server definitions shipped with WHMCS by default can be found in /resources/domains/dist.whois.json. This file should not be edited.

Prior to WHMCS 7.0, this file was located at /includes/whoisservers.php in a different format

To add or edit whois server definitions, begin by creating a custom whois.json file located at /resources/domains/whois.json

Inside it, define the whois servers you wish to add or modify only. This file will remain in place when updating WHMCS.

Below is a sample custom whois.json file defining the whois servers for .myextension and .myextension.com, and overriding the default whois server for .org

Sample whois.json Override File

[
    {
        "extensions": ".myextension,.myextension.com",
        "uri": "socket://whois.myextension.net",
        "available": "No match for"
    },
    {
        "extensions": ".org",
        "uri": "socket://whois.my-org-whois.net:96",
        "available": "NOT FOUND"
    }
]

A WHOIS Server definition is made up of four parts.

  • extensions - A comma separated list of extensions that this WHOIS server will be used for. In the above example there are two whois servers defined, but three extensions for which lookups are defined.
  • uri - This is the server that will be connected to. A whois based server should begin with socket:// and a web based request should begin with http:// or https:// A port for the server can be provided using :port on this field.
  • available - This is the string that WHMCS will match against to determine an available domain. This string must only appear in the output when the domain is available.

Where can I find other WHOIS Servers?

An extensive list of whois servers can be found at IANA, if it not listed you will need to contact the registry to find out the appropriate information.