Fortinet white logo
Fortinet white logo

CLI Reference

config dns-entry

config dns-entry

Description: Configure DNS entries.

config dns-entry

edit <name>

set status [enable | disable]

set type [A | NS | CNAME | MX | PTR]

set *hostname {string}

set *ip {ipv4-address} *available when type is set to A or PTR

set *canonical-name {string} *available when type is set to CNAME

set preference [0 – 65535] *available when type is set to MX

unset

next

show

abort

end

delete <name>

purge

show

end

next

Sample command:
FX201E5919000057 (dns-database) # show
config system dns-database
    edit 1
        set status enable
        set domain example.com
        set type primary
        set view public
        set primary-name dns
        set contact host
        set ttl 86400
        set authoritative enable
        set forwarder 1.2.4.8 8.8.4.4
        set source-ip
        config dns-entry
            edit 1
                set status enable
                set type A
                set ttl 0
                set hostname host1
                set ip 172.30.145.225
            next
        end
    next
end
Parameter Description Type Size Default
name The DNS entry ID number. integer 1 - 4294967295 none
status The resource record status. option - enable
Option Description
enable Enable resource record.
disable Disable resource record.
type Resource record type. option - A
Option Description
A Address record.
NS Name server record.
CNAME Canonical name record.
MX Mail exchange record.
PTR PTR resource record.
ttl The time-to-live value (in seconds) for the entry. integer 0 - 2147483647 0
hostname Name of the host. string - none
ip IP address of the host. IPv4 address - none

config dns-entry

config dns-entry

Description: Configure DNS entries.

config dns-entry

edit <name>

set status [enable | disable]

set type [A | NS | CNAME | MX | PTR]

set *hostname {string}

set *ip {ipv4-address} *available when type is set to A or PTR

set *canonical-name {string} *available when type is set to CNAME

set preference [0 – 65535] *available when type is set to MX

unset

next

show

abort

end

delete <name>

purge

show

end

next

Sample command:
FX201E5919000057 (dns-database) # show
config system dns-database
    edit 1
        set status enable
        set domain example.com
        set type primary
        set view public
        set primary-name dns
        set contact host
        set ttl 86400
        set authoritative enable
        set forwarder 1.2.4.8 8.8.4.4
        set source-ip
        config dns-entry
            edit 1
                set status enable
                set type A
                set ttl 0
                set hostname host1
                set ip 172.30.145.225
            next
        end
    next
end
Parameter Description Type Size Default
name The DNS entry ID number. integer 1 - 4294967295 none
status The resource record status. option - enable
Option Description
enable Enable resource record.
disable Disable resource record.
type Resource record type. option - A
Option Description
A Address record.
NS Name server record.
CNAME Canonical name record.
MX Mail exchange record.
PTR PTR resource record.
ttl The time-to-live value (in seconds) for the entry. integer 0 - 2147483647 0
hostname Name of the host. string - none
ip IP address of the host. IPv4 address - none