isPlainHostName(host) | True if the host name has no dot (e.g. intranet) | False for IPv6 addresses (containing :) |
dnsDomainIs(host, domain) | True if host ends with domain | Case-sensitive. Without the leading dot, "example.com" also matches badexample.com |
localHostOrDomainIs(host, hostdom) | True if they are identical, or if a host with no domain matches the start of hostdom | localHostOrDomainIs("www", "www.example.com") is true |
isResolvable(host) | True if the host resolves to an IP address | False for hosts not in the host-to-IP table |
isInNet(host, pattern, mask) | True if the IP address is in that network | A host name is resolved through the table first. The mask must be dotted ("255.255.0.0"); /16 does not work |
dnsResolve(host) | Returns the IP address | null if it can't be resolved |
convert_addr(ip) | Converts an IP address to a 32-bit integer | Signed, as in browsers (192.168.0.1 is negative) |
myIpAddress() | The client's own IP address | Returns the value from the settings |
dnsDomainLevels(host) | The number of dots | www.example.com gives 2 |
shExpMatch(str, pattern) | Wildcard match | * is zero or more characters, ? exactly one. True only if the whole string matches. Case-sensitive. Other characters are literal here, but some browsers treat [ ] or + as regular expression syntax, so avoid them |
weekdayRange(wd1, wd2, "GMT") | Day-of-week range | Three upper-case English letters such as "MON". Can wrap around the week ("FRI", "MON"). A final "GMT" uses the UTC day |
dateRange(…) | Range of days, months and years | If the range ends with a month only, it runs to the last day of that month (browser implementations can be a few days off in months with fewer than 31 days) |
timeRange(…) | Time-of-day range | timeRange(9, 17) means 9:00 to 17:59. Hours-only ranges do not wrap past midnight (timeRange(22, 6) is always false); timeRange(22, 0, 6, 0) does |
alert(message) | Outputs a message | Shown on that URL's row in the results |