Scenario 2: Should not contain a specific IP address
Use this field if you want to make sure a particular IP (e.g., a retired or malicious IP) does not appear in DNS resolution. Consider the below example:
Regex pattern: ${^((?!(<IP_ADDRESS>)).)*$}
Example: ${^((?!(100\.100\.10\.10|10\.100\.10\.11)).)*$}
Explanation:
- ${}: Site24x7 pattern to configure regex.
- ^: Start of the string.
- (?!.*100\.100\.10\.10): Negative lookahead; ensures this specific IP does not appear anywhere in the string.
- .*: Matches any remaining characters.
This regex pattern alerts you only if either the IP 100.100.10.10 or 10.100.10.11 appears in the DNS response.
Scenario 3: Notify when any new IP address is added
Use this setting when you want to receive an alert if an unauthorized IP address is detected. Consider the below example:
Regex pattern: ${^(<IP_ADDRESS>)$}
Example: ${^(100\.100\.10\.10|100\.100\.10\.11)$}
Explanation:
- ^: Start of the string.
- (100\.100\.10\.11): Ensures this specific IP is available for your domain.
If the response deviates from the defined pattern—such as when a new IP address (e.g., xxx.xx.xx.xx) is added—it won’t match, triggering an alert.