I got a question in the SeoTools Community Forum on how to setup a .fr TLD in SeoTools.config.xml and decided to make a blog post about it.

This post assumes some knowledge in regular expressions. If you don’t know this already, regular expression are extremely powerful and really useful when working with SEO. Start by reading An SEO’s Guide to RegEx.

In SeoTools.config.xml you can add additional TLDs to support functions that use whois such as WhoIs, WhoIsDomainExpires, WhoIsDomainUpdated, WhoIsDomainCreated, DomainAge and IsDomainRegistered.

In SeoTools.config.xml, in the section <Tlds> add:

<Tld Name=”fr” WhoIsServer=”" WhoIsNotFoundRegex=”" WhoIsCreatedRegex=”" WhoIsUpdatedRegex=”" WhoIsExpiresRegex=”" WhoIsDelayMs=”1000″/>  

First we figure out a good WhoIsServer for .fr. Googling “Whois server france” gives us “whois.nic.fr”. (Also .whois-servers.net usually works).

Now we do a whois search for a domain we know exist. Either find a whois service for your particular TLD or use a command line tools such as Whois in Sysinternals.

Whois setup

Then we figure out the regular expression for parsing out the part that we need. To do this, I copy the whois text into RegExr.

Whois editor

For WhoIsCreatedRegex we create the regular expression (?:created:\s*(\d{2}/\d{2}/\d{4})). Do the same for WhoIsUpdatedRegex and WhoIsExpiresRegex.

We now finally need to figure out what happens when getting whois for a domain that doesn’t exist.

Configure Whois

We see that if the domain isn’t registered, the text “no entries found” is present in the whois result.

Our final <Tld> is now:

<Tld Name=”fr” WhoIsServer=”whois.nic.fr” WhoIsNotFoundRegex=”no entries found” WhoIsCreatedRegex=”(?:created:\s*(\d{2}/\d{2}/\d{4}))” WhoIsUpdatedRegex=”(?:last-update:\s*(\d{2}/\d{2}/\d{4}))” WhoIsExpiresRegex=”(?:anniversary:\s*(\d{2}/\d{2}))” WhoIsDelayMs=”1000″/>  

While working on this post I noticed that SeoTools wont propertly parse DD/MM/YYYY formatted dates. I will fix this in the next release of SeoTools (3.3). Until then only IsDomainRegistered will work properly with this configuration.

This was fixed in 3.3. Final for .fr is:

<Tld Name=”fr” WhoIsServer=”whois.nic.fr” WhoIsNotFoundRegex=”no entries found” WhoIsCreatedRegex=”(?:created:\s*(\d{2}/\d{2}/\d{4}))” WhoIsCreatedDateFormat=”dd/MM/yyyy” WhoIsUpdatedRegex=”(?:last-update:\s*(\d{2}/\d{2}/\d{4}))” WhoIsUpdatedDateFormat=”dd/MM/yyyy” WhoIsExpiresRegex=”(?:anniversary:\s*(\d{2}/\d{2}))” WhoIsExpiresDateFormat=”dd/MM” WhoIsDelayMs=”1000″/>  

If you manage to make a TLD setting, please share with the community by posting in the comment section below.