| 1 | <h2>Full example</h2> |
| 2 | <p><a href="http://www.yang-central.org/twiki/bin/view/Main/YangExamplesExecdDns">Source</a></p> |
| 3 | <pre><code>submodule execd-dns { |
| 4 | |
| 5 | belongs-to execd { prefix execd; } |
| 6 | |
| 7 | import inet-types { prefix inet; } |
| 8 | |
| 9 | include execd-types; |
| 10 | |
| 11 | description |
| 12 | "The 'dns' component provides support for configuring the DNS resolver. |
| 13 | |
| 14 | The 'domain' keyword of /etc/resolv.conf is not supported, since |
| 15 | it is equivalent to 'search' with a single domain. I.e. in terms |
| 16 | of the data model, the domains are always configured as 'search' |
| 17 | elements, even if there is only one. The set of available options |
| 18 | has been limited to those that are generally available across |
| 19 | different resolver implementations, and generally useful."; |
| 20 | |
| 21 | revision "2008-11-04" { |
| 22 | description "draft-ietf-netmod-yang-02 compatible."; |
| 23 | } |
| 24 | revision "2007-08-29" { |
| 25 | description "Syntax fixes after pyang validation."; |
| 26 | } |
| 27 | revision "2007-06-08" { |
| 28 | description "Initial revision."; |
| 29 | } |
| 30 | |
| 31 | grouping dns { |
| 32 | list search { |
| 33 | key name; |
| 34 | max-elements 3; |
| 35 | leaf name { type int32; } |
| 36 | leaf domain { type inet:host; } |
| 37 | } |
| 38 | list server { |
| 39 | key address; |
| 40 | max-elements 3; |
| 41 | ordered-by user; |
| 42 | leaf address { type inet:ip-address; } |
| 43 | } |
| 44 | container options { |
| 45 | leaf ndots { type uint8; } |
| 46 | leaf timeout { type uint8; } |
| 47 | leaf attempts { type uint8; } |
| 48 | } |
| 49 | } |
| 50 | }</code></pre> |