Dns-Options

These scenarios check DHCP server DNS and name resolution options. This includes: dns-server, domain-name, and domain-search.

Test DNS-Server Single

Description

This scenario checks the dns-server option with a single DNS server. The DHCP server configures one DNS server, and the client receives it in the lease. The client’s /etc/resolv.conf should be updated with this nameserver.

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address 10.0.0.1/24
set service dhcp-server shared-network dns-single subnet 10.0.0.0/24 options dns-server 8.8.8.8
set service dhcp-server shared-network dns-single subnet 10.0.0.0/24 start 10.0.0.5 stop 10.0.0.5
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Set the following configuration in DUT1 :

set interfaces ethernet eth0 address dhcp
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 3: Run command interfaces ethernet eth0 show at DUT1 and check if output contains the following tokens:

10.0.0.5
Show output
-----------------------------------------------------------------
Name           IP Address           Admin  Oper  Vrf  Description
-----------------------------------------------------------------
eth0  10.0.0.5/24                   up     up
      fe80::dcad:beff:feef:6c10/64

Step 4: Run command show monitor-db system dhcp interface eth0 dns-servers at DUT1 and expect this output:

Show output
8.8.8.8

Test DNS-Server Multiple

Description

This scenario checks the dns-server option with multiple DNS servers. The DHCP server configures three DNS servers, and the client receives all of them. The servers should appear in the client’s /etc/resolv.conf in the configured order.

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address 10.0.0.1/24
set service dhcp-server shared-network dns-multiple subnet 10.0.0.0/24 options dns-server 1.1.1.1
set service dhcp-server shared-network dns-multiple subnet 10.0.0.0/24 options dns-server 8.8.4.4
set service dhcp-server shared-network dns-multiple subnet 10.0.0.0/24 options dns-server 8.8.8.8
set service dhcp-server shared-network dns-multiple subnet 10.0.0.0/24 start 10.0.0.5 stop 10.0.0.5
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Set the following configuration in DUT1 :

set interfaces ethernet eth0 address dhcp
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 3: Run command interfaces ethernet eth0 show at DUT1 and check if output contains the following tokens:

10.0.0.5
Show output
-----------------------------------------------------------------
Name           IP Address           Admin  Oper  Vrf  Description
-----------------------------------------------------------------
eth0  10.0.0.5/24                   up     up
      fe80::dcad:beff:feef:6c10/64

Step 4: Run command show monitor-db system dhcp interface eth0 dns-servers at DUT1 and expect this output:

Show output
8.8.8.8, 8.8.4.4, 1.1.1.1

Test DNS-Server VRF

Description

This scenario checks the dns-server option when the DHCP server is configured with VRF. Multiple DNS servers are configured in a VRF environment, and the client receives them correctly.

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address 10.0.0.1/24
set interfaces ethernet eth0 vrf VRF0
set service dhcp-server shared-network dns-vrf local-vrf VRF0
set service dhcp-server shared-network dns-vrf subnet 10.0.0.0/24 options dns-server 8.8.4.4
set service dhcp-server shared-network dns-vrf subnet 10.0.0.0/24 options dns-server 8.8.8.8
set service dhcp-server shared-network dns-vrf subnet 10.0.0.0/24 start 10.0.0.5 stop 10.0.0.5
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set system vrf VRF0

Step 2: Set the following configuration in DUT1 :

set interfaces ethernet eth0 address dhcp
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 3: Run command interfaces ethernet eth0 show at DUT1 and check if output contains the following tokens:

10.0.0.5
Show output
-----------------------------------------------------------------
Name           IP Address           Admin  Oper  Vrf  Description
-----------------------------------------------------------------
eth0  10.0.0.5/24                   up     up
      fe80::dcad:beff:feef:6c10/64

Step 4: Run command show monitor-db system dhcp interface eth0 dns-servers at DUT1 and expect this output:

Show output
8.8.8.8, 8.8.4.4

Test Domain-Name

Description

This scenario checks the domain-name option. The DHCP server configures a domain name, and the client receives it in the lease. The domain name should appear in the client’s /etc/resolv.conf.

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address 10.0.0.1/24
set service dhcp-server shared-network domain-name subnet 10.0.0.0/24 options domain-name example.com
set service dhcp-server shared-network domain-name subnet 10.0.0.0/24 start 10.0.0.5 stop 10.0.0.5
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Set the following configuration in DUT1 :

set interfaces ethernet eth0 address dhcp
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 3: Run command interfaces ethernet eth0 show at DUT1 and check if output contains the following tokens:

10.0.0.5
Show output
-----------------------------------------------------------------
Name           IP Address           Admin  Oper  Vrf  Description
-----------------------------------------------------------------
eth0  10.0.0.5/24                   up     up
      fe80::dcad:beff:feef:6c10/64

Step 4: Run command show monitor-db system dhcp interface eth0 domain-name at DUT1 and expect this output:

Show output
example.com

Test Domain-Name VRF

Description

This scenario checks the domain-name option when the DHCP server is configured with VRF. The domain name is configured in a VRF environment, and the client receives it correctly.

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address 10.0.0.1/24
set interfaces ethernet eth0 vrf VRF0
set service dhcp-server shared-network domain-name-vrf local-vrf VRF0
set service dhcp-server shared-network domain-name-vrf subnet 10.0.0.0/24 options domain-name example.com
set service dhcp-server shared-network domain-name-vrf subnet 10.0.0.0/24 start 10.0.0.5 stop 10.0.0.5
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set system vrf VRF0

Step 2: Set the following configuration in DUT1 :

set interfaces ethernet eth0 address dhcp
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 3: Run command interfaces ethernet eth0 show at DUT1 and check if output contains the following tokens:

10.0.0.5
Show output
-----------------------------------------------------------------
Name           IP Address           Admin  Oper  Vrf  Description
-----------------------------------------------------------------
eth0  10.0.0.5/24                   up     up
      fe80::dcad:beff:feef:6c10/64

Step 4: Run command show monitor-db system dhcp interface eth0 domain-name at DUT1 and expect this output:

Show output
example.com

Test Change DNS-Server

Description

This scenario checks that DNS servers can be changed dynamically. Configure initial DNS servers, then change them and verify the client receives the new values.

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address 10.0.0.1/24
set service dhcp-server shared-network dns-single subnet 10.0.0.0/24 options dns-server 8.8.8.8
set service dhcp-server shared-network dns-single subnet 10.0.0.0/24 start 10.0.0.5 stop 10.0.0.5
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Set the following configuration in DUT1 :

set interfaces ethernet eth0 address dhcp
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 3: Run command interfaces ethernet eth0 show at DUT1 and check if output contains the following tokens:

10.0.0.5
Show output
-----------------------------------------------------------------
Name           IP Address           Admin  Oper  Vrf  Description
-----------------------------------------------------------------
eth0  10.0.0.5/24                   up     up
      fe80::dcad:beff:feef:6c10/64

Step 4: Run command show monitor-db system dhcp interface eth0 dns-servers at DUT1 and expect this output:

Show output
8.8.8.8

Step 5: Modify the following configuration lines in DUT0 :

set service dhcp-server shared-network dns-single subnet 10.0.0.0/24 options dns-server 8.8.4.4

Step 6: Run command show monitor-db system dhcp interface eth0 dns-servers at DUT1 and expect this output:

Show output
8.8.8.8, 8.8.4.4

Test Change Domain-Name

Description

This scenario checks that the domain name can be changed dynamically. Configure an initial domain name, then change it and verify the client receives the new value.

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address 10.0.0.1/24
set service dhcp-server shared-network domain-name subnet 10.0.0.0/24 options domain-name example.com
set service dhcp-server shared-network domain-name subnet 10.0.0.0/24 start 10.0.0.5 stop 10.0.0.5
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Set the following configuration in DUT1 :

set interfaces ethernet eth0 address dhcp
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 3: Run command interfaces ethernet eth0 show at DUT1 and check if output contains the following tokens:

10.0.0.5
Show output
-----------------------------------------------------------------
Name           IP Address           Admin  Oper  Vrf  Description
-----------------------------------------------------------------
eth0  10.0.0.5/24                   up     up
      fe80::dcad:beff:feef:6c10/64

Step 4: Run command show monitor-db system dhcp interface eth0 domain-name at DUT1 and expect this output:

Show output
example.com

Step 5: Modify the following configuration lines in DUT0 :

set service dhcp-server shared-network domain-name subnet 10.0.0.0/24 options domain-name test.com

Step 6: Run command show monitor-db system dhcp interface eth0 domain-name at DUT1 and expect this output:

Show output
test.com

Test Remove DNS-Server

Description

This scenario checks that DNS servers can be removed. Configure DNS servers, then remove them and verify they are no longer sent to the client.

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address 10.0.0.1/24
set service dhcp-server shared-network dns-multiple subnet 10.0.0.0/24 options dns-server 1.1.1.1
set service dhcp-server shared-network dns-multiple subnet 10.0.0.0/24 options dns-server 8.8.4.4
set service dhcp-server shared-network dns-multiple subnet 10.0.0.0/24 options dns-server 8.8.8.8
set service dhcp-server shared-network dns-multiple subnet 10.0.0.0/24 start 10.0.0.5 stop 10.0.0.5
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Set the following configuration in DUT1 :

set interfaces ethernet eth0 address dhcp
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 3: Run command interfaces ethernet eth0 show at DUT1 and check if output contains the following tokens:

10.0.0.5
Show output
-----------------------------------------------------------------
Name           IP Address           Admin  Oper  Vrf  Description
-----------------------------------------------------------------
eth0  10.0.0.5/24                   up     up
      fe80::dcad:beff:feef:6c10/64

Step 4: Run command show monitor-db system dhcp interface eth0 dns-servers at DUT1 and expect this output:

Show output
8.8.8.8, 8.8.4.4, 1.1.1.1

Step 5: Modify the following configuration lines in DUT0 :

delete service dhcp-server shared-network dns-multiple subnet 10.0.0.0/24 options

Step 6: Run command show monitor-db system dhcp interface eth0 dns-servers at DUT1 and expect this output: