Configure Custom DNS Rules

To reach internal testing environments, it is often necessary to set custom DNS rules. This is possible for admin users in webmate via the DNS Management options. Note that this feature is not available per default but has to be enabled first. Please reach out to us if you are interested.

To access the DNS settings in webmate, first navigate to the Administration section (1) then click on Infrastructure (2) and finally go to the DNS Management tab (3).
If the tab is not shown to you here, the DNS management feature is not enabled for your organization, if you want to use this feature please let us know.
Creating Rules

To access the DNS settings in webmate, first navigate to the Administration section (1) then click on Infrastructure (2) and finally go to the DNS Management tab (3). If the tab is not shown to you here, the DNS management feature is not enabled, for your organization. If you want to use this feature please let us know.

Depending on the kind of rule that you want to create, a dialog will appear where you can enter the desired settings (1). To confirm the settings, click on the checkmark symbol (2), afterwards you can create more entries or apply the current settings by clicking on Save (3).
Note that whenever changes are saved, the DNS Server responsible for your organization in webmate will be restarted, which can lead to short network outages. Since many applications and operating systems use caches for DNS Settings, your changes might take some time to become active.
Available Rule Types
The following section will explain the types of DNS Settings that are available in webmate.
Domain Name
Domain Name Rules are the most basic form of DNS Setting. They allow you to pin single or multiple domain names to a static IP. See below to see how domain names are matched.
Upstream Server
Upstream DNS Rules allow you to forward DNS requests for a certain domain to another DNS Server. The domain names are matched as described below and all DNS requests for these domains are forwarded to the DNS Server running at the specified IP-Address. Please note that configuring an unreachable or unresponsive upstream DNS server will interfere with network connections for the matched domains.
CNAME
CNAME DNS Rules allow aliasing of matched domain names by resolving them to the same IP as another specified domain name. Configuring CNAME settings can often save time when server IP addresses have changed and need to be updated.
Blackhole
Blackhole DNS Rules can be used to block certain domains from being resolved on your devices. This is useful, for example, to prevent tests from running in production environments accidentally.
Matching Domain Names
There are two methods in place to match domain names: A simple suffix match and matching via regular expressions.
Whenever possible, webmate will prefer matching via suffix matches. This means that if you enter a hostname without any special character reserved for regular expression webmate will treat it as a suffix match, if that is no possible it will be considered a regular expression.
Suffix matches
A suffix match in this case means that a specified domain will match exact matches and all subdomains. As an example, consider the following entry:

This entry will match the domains wikipedia.org, en.wikipedia.org as well as img.en.wikipedia.org but not mywikipedia.org.
For most use-cases suffix matches should be sufficient.
Matching by Regular Expression
For more complex DNS settings webmate accepts a simple regular expression syntax for domain names. If you are not familiar with regular expressions you might want to read this first (opens in a new tab) .
When evaluating regular expressions webmate enforces that all regular expressions always match the entire domain. This means that the regex \w\.com will match testfabrik.com and example.com but not subdomains of these sites. In addition matches are always performed case-insensitive.
The regular expression syntax webmate accepts is defined below.
Character Types
. | matches any character |
\w | a word character (like [a-z0-9]) |
\W | a non-word character (anything except \w) |
\d | a decimal digit |
\D | a character that is not a decimal digit |
Character Classes
[...] | positive character class |
[^...] | negative character class |
[x-y] | range |
Quantifiersall greedy
? | 0 or 1 |
* | 0 or more |
+ | 1 or more |
{n} | exactly n |
{n,m} | at least n, no more than m |
{n,} | n or more |
Groups
(...) | a group |
Alternation
left|right | matches what either left or right sub-regex matches |
Conflicting Rules
It is quite simple to build DNS Rules using the settings explained in this article so that a single domain name is matched by multiple rules. For example consider the following settings:
- A suffix matching rule for
wikipedia.org - A regex matching rule with the regex
wiki.*
Both of these rules will match the domain name en.wikipedia.org but for technical reasons it cannot be predicted which rule will be selected in the end. Therefore to prevent building unstable DNS settings we advise you to avoid having conflicting entries in the first place by defining stricter matching rules.