Fortinet white logo
Fortinet white logo

CLI Reference

config dnsfilter domain-filter

config dnsfilter domain-filter

Description: Configure a set of domain filter entries.

config dnsfilter domain-filter
  edit <name>
    set comments <string>
    config entries
      edit <name>
        set domain <string>
        set type [simple | wildcard | regex]
        set action [block | allow]
        set status [enable | disable]
      next
    end
  next
end
Parametrer Description Type Size Default

comments

Comments for this set of domain filter entries

string

-

config entries
Parameter Description

Type

Size

Default

entries

A set of DNS filter entries.

table

-

domain

A string for domain name, or wildcard, or regression expression.

string

-

type

Select an entry type

option

-

Option Description
simple Matches an exact string.

wildcard

Matches using regex rules for advanced pattern matching.

Note: If the domain string contains the character ?, it can only be configured through the GUI.

regex

Matches patterns using wildcards (e.g., *.example.com).

Note: Only the * wildcard is supported.

action

Select if you want to Block or Allow this entry.

option

-

Option Description
block If the local domain filter action is set to block and an entry matches, then that DNS query is blocked or redirected.

allow

If the local domain filter action is set to allow and an entry matches, it will directly return to the client DNS resolver.

status

Enable/Disable this domain filter entry.

option

-

Option Description
enable Enable this domain filter to take effect.

disable

Disable this domain filter.

config dnsfilter domain-filter

config dnsfilter domain-filter

Description: Configure a set of domain filter entries.

config dnsfilter domain-filter
  edit <name>
    set comments <string>
    config entries
      edit <name>
        set domain <string>
        set type [simple | wildcard | regex]
        set action [block | allow]
        set status [enable | disable]
      next
    end
  next
end
Parametrer Description Type Size Default

comments

Comments for this set of domain filter entries

string

-

config entries
Parameter Description

Type

Size

Default

entries

A set of DNS filter entries.

table

-

domain

A string for domain name, or wildcard, or regression expression.

string

-

type

Select an entry type

option

-

Option Description
simple Matches an exact string.

wildcard

Matches using regex rules for advanced pattern matching.

Note: If the domain string contains the character ?, it can only be configured through the GUI.

regex

Matches patterns using wildcards (e.g., *.example.com).

Note: Only the * wildcard is supported.

action

Select if you want to Block or Allow this entry.

option

-

Option Description
block If the local domain filter action is set to block and an entry matches, then that DNS query is blocked or redirected.

allow

If the local domain filter action is set to allow and an entry matches, it will directly return to the client DNS resolver.

status

Enable/Disable this domain filter entry.

option

-

Option Description
enable Enable this domain filter to take effect.

disable

Disable this domain filter.