< Home

add host (user-defined DNS category view)

Function

The add host command adds a domain name rule to a user-defined DNS category.

The undo add host command removes a domain name rule from a user-defined category.

Format

add host host-text

undo add host { host-text | all }

Parameters

Parameter Description Value
host-text

Specifies a domain name rule.

  • The value is a string of 4 to 255 characters and cannot contain slashes (/), backslashes (\), number signs (#), double quotation marks ("), or question marks (?).
  • The asterisk (*) can appear at the beginning, middle, or end of a domain name rule:
    • When it appears at the beginning, it is a wildcard character that indicates suffix matching, such as *abc.
    • When it appears in the middle, it is a common character, such as ab*c.
    • When it appears at the end, it is a wildcard character that indicates prefix matching, such as abc*.
    • When it appears at both the beginning and the end, it is a wildcard character and indicates keyword matching, such as *abc*.

    If a domain name rule contains a wildcard character, it must contain at least three consecutive characters except the wildcard character, such as *abc, *abc*, **ab, and *a*b.

  • If a domain name rule does not contain any wildcard character, the domain name is matched in exact matching mode. In this case, the domain name rule must contain at least four consecutive characters, such as abcd.
all

Indicates all domain name rules.

-

Views

User-defined DNS category view

Default Level

2: Configuration level

Usage Guidelines

None

Example

# Add domain name rule www.example.com in the view of user-defined category abc and set the matching mode to Exact.

<sysname> system-view
[sysname] dns-filter category user-defined name abc
[sysname-cate-user-defined-abc] add host www.example.com
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >