huawei-dns

DNS management.

  • Version: 2021-08-27

    huawei-dns@2021-08-27


    
      module huawei-dns {
    
        yang-version 1;
    
        namespace "urn:huawei:yang:huawei-dns";
    
        prefix dns;
    
        import huawei-network-instance {
          prefix ni;
        }
        import huawei-l3vpn {
          prefix l3vpn;
        }
        import ietf-inet-types {
          prefix inet;
        }
        import huawei-extension {
          prefix ext;
        }
    
        organization
          "Huawei Technologies Co., Ltd.";
    
        contact
          "Huawei Industrial Base
         Bantian, Longgang
         Shenzhen 518129
         People's Republic of China
         Website: http://www.huawei.com
         Email: support@huawei.com";
    
        description "DNS management.";
    
        revision "2021-08-27" {
          description
            "Modify the if-name of IPv6-servers.";
          reference
            "Huawei private.";
    
        }
    
        revision "2020-11-03" {
          description
            "Add IPv6-sources IPv4-hosts IPv6-hosts and modify IPv6-servers.";
          reference
            "Huawei private.";
    
        }
    
        revision "2020-04-24" {
          description "Init revision.";
          reference
            "Huawei private.";
    
        }
    
        ext:task-name "dns";
    
        container dns {
          description "DNS management.";
          container global {
            description
              "Configure determine whether to enable DNS.";
            leaf enable {
              type boolean;
              default "false";
              description
                "Enable/disable DNS enable flag.";
            }
          }  // container global
    
          container src-ips {
            description
              "List of IPv4 Source Server.";
            list src-ip {
              key "vrf-name source-ipv4-addr";
              description
                "Configure IPv4 Source Server.";
              leaf vrf-name {
                type leafref {
                  path "/ni:network-instance/ni:instances/ni:instance/ni:name";
                }
                must
                  "/ni:network-instance/ni:instances/ni:instance[ni:name = current()]/l3vpn:afs/l3vpn:af[l3vpn:type='ipv4-unicast']";
                description "VPN name.";
              }
    
              leaf source-ipv4-addr {
                type inet:ipv4-address-no-zone;
                description
                  "IPv4 address of source server.";
              }
            }  // list src-ip
          }  // container src-ips
    
          container ipv6-sources {
            description
              "List of IPv6 Source Server.";
            list ipv6-source {
              key "vpn ipv6-source-addr";
              description
                "Configure IPv6 Source Server.";
              leaf vpn {
                type leafref {
                  path "/ni:network-instance/ni:instances/ni:instance/ni:name";
                }
                must
                  "/ni:network-instance/ni:instances/ni:instance[ni:name = current()]/l3vpn:afs/l3vpn:af[l3vpn:type='ipv6-unicast']";
                description "VPN name.";
              }
    
              leaf ipv6-source-addr {
                type inet:ipv6-address-no-zone;
                description
                  "IPv6 address of source server.";
              }
            }  // list ipv6-source
          }  // container ipv6-sources
    
          container timeout {
            description
              "Configure specifies the amount of time to wait for a response to a DNS query. If the ip domain timeout command is not configured, system will wait 3 seconds for a response to a DNS query.";
            leaf interval-time {
              type uint32 {
                range "1..10";
              }
              units "s";
              default "5";
              description
                "The amount of time to wait for a response to a DNS query (s).";
            }
          }  // container timeout
    
          container try-number {
            description
              "Configure specifies the number of times to retry sending DNS queries. If the ip domain retry command is not configured, system will retry DNS queries twice.";
            leaf probe-count {
              type uint32 {
                range "1..3";
              }
              default "2";
              description
                "Specifies the number of times to retry sending DNS queries.";
            }
          }  // container try-number
    
          container domains {
            description "List of domain.";
            list domain {
              key "vpn name";
              description
                "Configure domain name.";
              leaf vpn {
                type leafref {
                  path "/ni:network-instance/ni:instances/ni:instance/ni:name";
                }
                must
                  "/ni:network-instance/ni:instances/ni:instance[ni:name = current()]/l3vpn:afs/l3vpn:af[l3vpn:type='ipv4-unicast']";
                description "VPN name.";
              }
    
              leaf name {
                ext:case-sensitivity "lower-or-upper";
                type string {
                  length "1..63";
                }
                description "Domain name.";
              }
            }  // list domain
          }  // container domains
    
          container ipv4-hosts {
            description "List of IPv4 host.";
            list ipv4-host {
              key "vpn host";
              description "Configure IPv4 host.";
              leaf vpn {
                type leafref {
                  path "/ni:network-instance/ni:instances/ni:instance/ni:name";
                }
                must
                  "/ni:network-instance/ni:instances/ni:instance[ni:name = current()]/l3vpn:afs/l3vpn:af[l3vpn:type='ipv4-unicast']";
                description "VPN name.";
              }
    
              leaf host {
                type string {
                  length "1..255";
                }
                description "Host name.";
              }
    
              leaf address {
                type inet:ipv4-address-no-zone;
                mandatory true;
                description
                  "Address of IPv4 host.";
              }
            }  // list ipv4-host
          }  // container ipv4-hosts
    
          container ipv6-hosts {
            description "List of IPv6 host.";
            list ipv6-host {
              key "vpn host ipv6-address";
              description "Configure IPv6 host.";
              leaf vpn {
                type leafref {
                  path "/ni:network-instance/ni:instances/ni:instance/ni:name";
                }
                must
                  "/ni:network-instance/ni:instances/ni:instance[ni:name = current()]/l3vpn:afs/l3vpn:af[l3vpn:type='ipv6-unicast']";
                description "VPN name.";
              }
    
              leaf host {
                type string {
                  length "1..255";
                }
                description "Host name.";
              }
    
              leaf ipv6-address {
                type inet:ipv6-address-no-zone;
                description
                  "Address of IPv6 host.";
              }
            }  // list ipv6-host
          }  // container ipv6-hosts
    
          container ipv4-servers {
            description
              "List of DNS IPv4 server.";
            list ipv4-server {
              key "vpn address";
              description
                "Configure DNS IPv4 server.";
              leaf vpn {
                type leafref {
                  path "/ni:network-instance/ni:instances/ni:instance/ni:name";
                }
                must
                  "/ni:network-instance/ni:instances/ni:instance[ni:name = current()]/l3vpn:afs/l3vpn:af[l3vpn:type='ipv4-unicast']";
                description "VPN name.";
              }
    
              leaf address {
                type inet:ipv4-address-no-zone;
                description
                  "Address of IPv4 server.";
              }
            }  // list ipv4-server
          }  // container ipv4-servers
    
          container ipv6-servers {
            description
              "List of DNS IPv6 server.";
            list ipv6-server {
              key "vpn ipv6-address if-name";
              description
                "Configure DNS IPv6 server.";
              leaf vpn {
                type leafref {
                  path "/ni:network-instance/ni:instances/ni:instance/ni:name";
                }
                must
                  "/ni:network-instance/ni:instances/ni:instance[ni:name = current()]/l3vpn:afs/l3vpn:af[l3vpn:type='ipv6-unicast']";
                description "VPN name.";
              }
    
              leaf ipv6-address {
                type inet:ipv6-address-no-zone;
                must
                  "((starts-with(translate(., 'FEABab9', 'fe88888'), 'fe8')) and (../if-name)) or not(../if-name)";
                description
                  "IPv6 address of the DNS server, which can be a global unicast or link-local address.";
              }
    
              leaf if-name {
                type string {
                  length "0..63";
                }
                description
                  "Interface Name. If the IPv6 address of the DNS server is a global unicast address, no interface needs to be specified. Otherwise, specify the interface name.";
              }
            }  // list ipv6-server
          }  // container ipv6-servers
    
          container dns-pkt-stats {
            config false;
            description
              "Statistics of DNS packets.";
            leaf input-total {
              type uint32;
              config false;
              description
                "Total count of received packets.";
            }
    
            leaf output-total {
              type uint32;
              config false;
              description
                "Total count of sent packets.";
            }
    
            leaf drop-total {
              type uint32;
              config false;
              description
                "Total count of discarded packets.";
            }
    
            leaf rr-a {
              type uint32;
              config false;
              description
                "Count of received 'A' resource record types.";
            }
    
            leaf rr-aaaa {
              type uint32;
              config false;
              description
                "Count of received 'AAAA' resource record types.";
            }
    
            leaf rr-ptr {
              type uint32;
              config false;
              description
                "Count of received 'PTR' resource record types.";
            }
    
            leaf rr-cname {
              type uint32;
              config false;
              description
                "Count of received 'CNAME' resource record types.";
            }
    
            leaf rr-unknown {
              type uint32;
              config false;
              description
                "Count of received unknown resource record types.";
            }
    
            leaf standard {
              type uint32;
              config false;
              description
                "Count of sent standard query packets.";
            }
    
            leaf question-a {
              type uint32;
              config false;
              description
                "Count of sent 'A' query types.";
            }
    
            leaf question-aaaa {
              type uint32;
              config false;
              description
                "Count of sent 'AAAA' query types.";
            }
    
            leaf question-ptr {
              type uint32;
              config false;
              description
                "Count of sent 'PTR' query types.";
            }
    
            leaf rcv-tcp-total {
              type uint32;
              config false;
              description
                "Total count of received TCP packets.";
            }
    
            leaf rcv-udp-total {
              type uint32;
              config false;
              description
                "Total count of received UDP packets.";
            }
    
            leaf drop-tcp-total {
              type uint32;
              config false;
              description
                "Total count of discarded TCP packets.";
            }
    
            leaf drop-udp-total {
              type uint32;
              config false;
              description
                "Total count of discarded UDP packets.";
            }
    
            leaf drop-len {
              type uint32;
              config false;
              description
                "Count of discarded length error packets.";
            }
    
            leaf drop-id {
              type uint32;
              config false;
              description
                "Count of discarded ID error packets.";
            }
    
            leaf drop-server {
              type uint32;
              config false;
              description
                "Count of discarded server error packets.";
            }
    
            leaf drop-code {
              type uint32;
              config false;
              description
                "Count of discarded code error packets.";
            }
    
            leaf drop-tc {
              type uint32;
              config false;
              description
                "Count of discarded truncated error packets.";
            }
    
            leaf drop-query-cnt {
              type uint32;
              config false;
              description
                "Count of discarded query count error packets.";
            }
    
            leaf drop-answer-cnt {
              type uint32;
              config false;
              description
                "Count of discarded answer count error packets.";
            }
    
            leaf drop-expand-name {
              type uint32;
              config false;
              description
                "Count of discarded expand name error packets.";
            }
    
            leaf drop-class {
              type uint32;
              config false;
              description
                "Count of discarded class error packets.";
            }
    
            leaf drop-other {
              type uint32;
              config false;
              description
                "Count of discarded other error packets.";
            }
    
            leaf sent-udp-total {
              type uint32;
              config false;
              description
                "Total count of sent UDP packets.";
            }
    
            leaf sent-tcp-total {
              type uint32;
              config false;
              description
                "Total count of sent TCP packets.";
            }
          }  // container dns-pkt-stats
        }  // container dns
      }  // module huawei-dns
    

© 2023 YumaWorks, Inc. All rights reserved.