File tree 6 files changed +126
-2
lines changed
6 files changed +126
-2
lines changed Original file line number Diff line number Diff line change @@ -66,8 +66,9 @@ Table of Contents
66
66
* [ LOGGER] ( #logger )
67
67
* [ WRED_PROFILE] ( #wred_profile )
68
68
* [ PASSWORD_HARDENING] ( #password_hardening )
69
- * [ SYSTEM_DEFAULTS table] ( #systemdefaults-table )
70
- * [ RADIUS] ( #radius )
69
+ * [ SYSTEM_DEFAULTS table] ( #systemdefaults-table )
70
+ * [ RADIUS] ( #radius )
71
+ * [ Static DNS] ( #static-dns )
71
72
* [ For Developers] ( #for-developers )
72
73
* [ Generating Application Config by Jinja2 Template] ( #generating-application-config-by-jinja2-template )
73
74
* [ Incremental Configuration by Subscribing to ConfigDB] ( #incremental-configuration-by-subscribing-to-configdb )
@@ -2096,6 +2097,19 @@ The RADIUS and RADIUS_SERVER tables define RADIUS configuration parameters. RADI
2096
2097
}
2097
2098
```
2098
2099
2100
+ ### Static DNS
2101
+
2102
+ The DNS_NAMESERVER table introduces static DNS nameservers configuration.
2103
+
2104
+ ``` json
2105
+ {
2106
+ "DNS_NAMESERVER" : {
2107
+ "1.1.1.1" : {},
2108
+ "fe80:1000:2000:3000::1" : {}
2109
+ },
2110
+ }
2111
+ ```
2112
+
2099
2113
#### 5.2.3 Update value directly in db memory
2100
2114
2101
2115
For Developers
Original file line number Diff line number Diff line change @@ -107,6 +107,7 @@ def run(self):
107
107
'./yang-models/sonic-device_neighbor_metadata.yang' ,
108
108
'./yang-models/sonic-dhcp-server.yang' ,
109
109
'./yang-models/sonic-dhcpv6-relay.yang' ,
110
+ './yang-models/sonic-dns.yang' ,
110
111
'./yang-models/sonic-events-bgp.yang' ,
111
112
'./yang-models/sonic-events-common.yang' ,
112
113
'./yang-models/sonic-events-dhcp-relay.yang' ,
Original file line number Diff line number Diff line change 8
8
"192.0.0.8" : {},
9
9
"192.0.0.8" : {}
10
10
},
11
+ "DNS_NAMESERVER" : {
12
+ "1.1.1.1" : {},
13
+ "fe80:1000:2000:3000::1" : {}
14
+ },
11
15
"BUFFER_POOL" : {
12
16
"ingress_lossy_pool" : {
13
17
"mode" : " static" ,
Original file line number Diff line number Diff line change
1
+ {
2
+ "DNS_NAMESERVER_TEST" : {
3
+ "desc" : " DNS nameserver configuration in DNS_NAMESERVER table."
4
+ },
5
+ "DNS_NAMESERVER_TEST_INVALID_IP" : {
6
+ "desc" : " DNS nameserver configuration with invalid IP value in DNS_NAMESERVER table." ,
7
+ "eStr" : " Invalid value"
8
+ },
9
+ "DNS_NAMESERVER_TEST_MAX_IP_NUMBER" : {
10
+ "desc" : " DNS nameserver configuration exceeds the maximum IPs in DNS_NAMESERVER table." ,
11
+ "eStr" : " Too many elements."
12
+ }
13
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "DNS_NAMESERVER_TEST" : {
3
+ "sonic-dns:sonic-dns" : {
4
+ "sonic-dns:DNS_NAMESERVER" : {
5
+ "DNS_NAMESERVER_LIST" : [
6
+ {
7
+ "ip" : " 192.168.1.1"
8
+ },
9
+ {
10
+ "ip" : " fe80:1000:2000:3000::1"
11
+ }
12
+ ]
13
+ }
14
+ }
15
+ },
16
+ "DNS_NAMESERVER_TEST_INVALID_IP" : {
17
+ "sonic-dns:sonic-dns" : {
18
+ "sonic-dns:DNS_NAMESERVER" : {
19
+ "DNS_NAMESERVER_LIST" : [
20
+ {
21
+ "ip" : " 1.x.2.x"
22
+ }
23
+ ]
24
+ }
25
+ }
26
+ },
27
+ "DNS_NAMESERVER_TEST_MAX_IP_NUMBER" : {
28
+ "sonic-dns:sonic-dns" : {
29
+ "sonic-dns:DNS_NAMESERVER" : {
30
+ "DNS_NAMESERVER_LIST" : [
31
+ {
32
+ "ip" : " 192.168.1.1"
33
+ },
34
+ {
35
+ "ip" : " fe80:1000:2000:3000::2"
36
+ },
37
+ {
38
+ "ip" : " 192.168.1.3"
39
+ },
40
+ {
41
+ "ip" : " fe80:1000:2000:3000::4"
42
+ }
43
+ ]
44
+ }
45
+ }
46
+ }
47
+ }
Original file line number Diff line number Diff line change
1
+ module sonic-dns {
2
+
3
+ namespace "http://github.com/sonic-net/sonic-dns" ;
4
+ yang-version 1.1 ;
5
+ prefix dns;
6
+
7
+ import ietf-inet-types {
8
+ prefix inet;
9
+ }
10
+
11
+ organization
12
+ "SONiC" ;
13
+
14
+ contact
15
+ "SONiC" ;
16
+
17
+ description "DNS YANG module for SONiC OS" ;
18
+
19
+ revision 2023 -02 -14 {
20
+ description "Initial version" ;
21
+ }
22
+
23
+ container sonic-dns {
24
+
25
+ container DNS_NAMESERVER {
26
+
27
+ description "DNS_NAMESERVER part of config_db.json" ;
28
+
29
+ list DNS_NAMESERVER_LIST {
30
+ max-elements 3 ;
31
+ description "List of nameservers IPs" ;
32
+
33
+ key "ip" ;
34
+
35
+ leaf ip {
36
+ description "IP as DHCP_SERVER" ;
37
+ type inet:ip-address;
38
+ }
39
+ } /* end of list DNS_NAMESERVER_LIST */
40
+
41
+ } /* end of container DNS_NAMESERVER */
42
+
43
+ } /* end of container sonic-dns */
44
+
45
+ } /* end of module sonic-dns */
You can’t perform that action at this time.
0 commit comments