Interface IsFQDNorIPOptions

Options for FQDN or IP address validation.

interface IsFQDNorIPOptions {
    allowRange?: boolean;
    allowWildcard?: boolean;
    requireTld?: boolean;
    version?:
        | 4
        | 6
        | "4"
        | "6";
}

Properties

allowRange?: boolean

Allows IP range input (e.g., 127.0.0.1/24, 2001::/128) if true (IP only). Defaults to false.

allowWildcard?: boolean

Allows wildcard domains (e.g., *.example.com) if true (FQDN only). Defaults to false.

requireTld?: boolean

Requires a Top-Level Domain (TLD) if true (FQDN only). Defaults to true.

version?:
    | 4
    | 6
    | "4"
    | "6"

IP version to check. 4, 6, "4", or "6". Defaults to undefined (allows both versions).