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:


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

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

Back to Tutorials


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

Our Contacts

The Guild Hub, High Street
Bath BA1 5EB