Tutorials - Creating a Regex Record

Back to Tutorials

This tutorial will show you how to create an A Record that uses a regular expression to match a domain. Regular expressions matches are not a standard feature of DNS servers and is powerful feature of Refract DNS. Refract DNS uses .NET regular expressions which may different from other implementations of regular expressions.

Regular expressions give the user a lot more flexibility to match multiple domains that couldn't normally be matched using a Wildcard Record. For example we might have the following domains:

  • website-client1.refractdns.com
  • client1-backoffice.refractdns.com
  • email-client1.refractdns.com

All these domains need to point at a single IP based on the fact that client1 appears in the domain. This cannot be achieved by using a wildcard because a wildcard must match a whole DNS label and not part of the the label. Instead the following regular expression can be used:

    .*client1.refractdns.com

In this tutorial we will point the domains below at the IP address 127.0.0.1.

  • www-client1.refractdns.com
  • mail.client1.refractdns.com

Back to Tutorials

About

Remove the frustration of the Windows hosts file and take control of your DNS.

Share
Our Contacts

The Guild Hub, High Street
Bath BA1 5EB