Dns Priority

Test suite to check DNS service priorities

Valid Address

Description

Configures a simple, valid address and checks the DNS can resolve it. There is no priority involved as a single address is in use.

Scenario

Step 1: Set the following configuration in DUT0:

set interfaces ethernet eth0 address 10.0.0.1/24
set interfaces ethernet eth0 address 10::1/64
set service dns forwarding logs
set service dns resolver local
set service dns forwarding name-server 10.0.0.2

Step 2: Run command show host lookup teldat.com type A wait 0 at DUT0 and check if output contains the following tokens:

172.24.0.11
Show output
teldat.com has address 172.24.0.11

Step 3: Run command service dns forwarding show logs | cat at DUT0 and expect this output:

Show output
-- Logs begin at Mon 2023-10-30 11:38:15 UTC, end at Mon 2023-10-30 11:38:18 UTC. --
Oct 30 11:38:17 osdx dnsmasq[23441]: dnsmasq: syntax check OK.
Oct 30 11:38:17 osdx dnsmasq[23448]: started, version 2.80 cachesize 150
Oct 30 11:38:17 osdx dnsmasq[23448]: DNS service limited to local subnets
Oct 30 11:38:17 osdx dnsmasq[23448]: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth DNSSEC loop-detect inotify dumpfile
Oct 30 11:38:17 osdx dnsmasq[23448]: warning: ignoring resolv-file flag because no-resolv is set
Oct 30 11:38:17 osdx dnsmasq[23448]: using nameserver 10.0.0.2#53
Oct 30 11:38:17 osdx dnsmasq[23448]: read /etc/hosts - 1 addresses
Oct 30 11:38:18 osdx dnsmasq[23448]: query[A] teldat.com from ::1
Oct 30 11:38:18 osdx dnsmasq[23448]: forwarded teldat.com to 10.0.0.2
Oct 30 11:38:18 osdx dnsmasq[23448]: reply teldat.com is 172.24.0.11

Valid Address IPv6

Description

Configures a simple, valid IPv6 address and checks the DNS can resolve it. There is no priority involved as a single address is in use.

Scenario

Step 1: Set the following configuration in DUT0:

set interfaces ethernet eth0 address 10.0.0.1/24
set interfaces ethernet eth0 address 10::1/64
set service dns forwarding logs
set service dns resolver local
set service dns forwarding name-server 10::2

Step 2: Run command show host lookup teldat.com type A wait 0 at DUT0 and check if output contains the following tokens:

172.24.0.11
Show output
teldat.com has address 172.24.0.11

Step 3: Run command service dns forwarding show logs | cat at DUT0 and expect this output:

Show output
-- Logs begin at Mon 2023-10-30 11:38:23 UTC, end at Mon 2023-10-30 11:38:27 UTC. --
Oct 30 11:38:25 osdx dnsmasq[23793]: dnsmasq: syntax check OK.
Oct 30 11:38:25 osdx dnsmasq[23800]: started, version 2.80 cachesize 150
Oct 30 11:38:25 osdx dnsmasq[23800]: DNS service limited to local subnets
Oct 30 11:38:25 osdx dnsmasq[23800]: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth DNSSEC loop-detect inotify dumpfile
Oct 30 11:38:25 osdx dnsmasq[23800]: warning: ignoring resolv-file flag because no-resolv is set
Oct 30 11:38:25 osdx dnsmasq[23800]: using nameserver 10::2#53
Oct 30 11:38:25 osdx dnsmasq[23800]: read /etc/hosts - 1 addresses
Oct 30 11:38:25 osdx dnsmasq[23800]: query[A] teldat.com from ::1
Oct 30 11:38:25 osdx dnsmasq[23800]: forwarded teldat.com to 10::2
Oct 30 11:38:26 osdx dnsmasq[23800]: query[A] teldat.com from 127.0.0.1
Oct 30 11:38:27 osdx dnsmasq[23800]: query[A] teldat.com from ::1
Oct 30 11:38:27 osdx dnsmasq[23800]: forwarded teldat.com to 10::2
Oct 30 11:38:27 osdx dnsmasq[23800]: reply teldat.com is 172.24.0.11

Multiple Addresses

Description

Configures two DNS addresses: one invalid and the other valid. Checks that the resolution works against the second address, while the first one does not respond.

Scenario

Step 1: Set the following configuration in DUT0:

set interfaces ethernet eth0 address 10.0.0.1/24
set interfaces ethernet eth0 address 10::1/64
set service dns forwarding logs
set service dns resolver local
set service dns forwarding name-server 10.0.0.10 priority 0
set service dns forwarding name-server 10.0.0.2 priority 1

Step 2: Run command show host lookup teldat.com type A wait 0 at DUT0 and check if output contains the following tokens:

172.24.0.11
Show output
teldat.com has address 172.24.0.11

Step 3: Run command service dns forwarding show logs | cat at DUT0 and expect this output:

Show output
-- Logs begin at Mon 2023-10-30 11:38:31 UTC, end at Mon 2023-10-30 11:38:36 UTC. --
Oct 30 11:38:33 osdx dnsmasq[24146]: dnsmasq: syntax check OK.
Oct 30 11:38:33 osdx dnsmasq[24153]: started, version 2.80 cachesize 150
Oct 30 11:38:33 osdx dnsmasq[24153]: DNS service limited to local subnets
Oct 30 11:38:33 osdx dnsmasq[24153]: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth DNSSEC loop-detect inotify dumpfile
Oct 30 11:38:33 osdx dnsmasq[24153]: warning: ignoring resolv-file flag because no-resolv is set
Oct 30 11:38:33 osdx dnsmasq[24153]: using nameserver 10.0.0.10#53
Oct 30 11:38:33 osdx dnsmasq[24153]: using nameserver 10.0.0.2#53
Oct 30 11:38:33 osdx dnsmasq[24153]: read /etc/hosts - 1 addresses
Oct 30 11:38:34 osdx dnsmasq[24153]: query[A] teldat.com from ::1
Oct 30 11:38:34 osdx dnsmasq[24153]: forwarded teldat.com to 10.0.0.10
Oct 30 11:38:35 osdx dnsmasq[24153]: query[A] teldat.com from 127.0.0.1
Oct 30 11:38:36 osdx dnsmasq[24153]: query[A] teldat.com from ::1
Oct 30 11:38:36 osdx dnsmasq[24153]: forwarded teldat.com to 10.0.0.2
Oct 30 11:38:36 osdx dnsmasq[24153]: reply teldat.com is 172.24.0.11

Multiple IPv6 Addresses

Description

Configures two IPv6 DNS addresses: one invalid and the other valid. Checks that the resolution works against the second address, while the first one does not respond.

Scenario

Step 1: Set the following configuration in DUT0:

set interfaces ethernet eth0 address 10.0.0.1/24
set interfaces ethernet eth0 address 10::1/64
set service dns forwarding logs
set service dns resolver local
set service dns forwarding name-server 10::10 priority 0
set service dns forwarding name-server 10::2 priority 1

Step 2: Run command show host lookup teldat.com type A wait 0 at DUT0 and check if output contains the following tokens:

172.24.0.11
Show output
teldat.com has address 172.24.0.11

Step 3: Run command service dns forwarding show logs | cat at DUT0 and expect this output:

Show output
-- Logs begin at Mon 2023-10-30 11:38:40 UTC, end at Mon 2023-10-30 11:38:45 UTC. --
Oct 30 11:38:42 osdx dnsmasq[24499]: dnsmasq: syntax check OK.
Oct 30 11:38:42 osdx dnsmasq[24506]: started, version 2.80 cachesize 150
Oct 30 11:38:42 osdx dnsmasq[24506]: DNS service limited to local subnets
Oct 30 11:38:42 osdx dnsmasq[24506]: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth DNSSEC loop-detect inotify dumpfile
Oct 30 11:38:42 osdx dnsmasq[24506]: warning: ignoring resolv-file flag because no-resolv is set
Oct 30 11:38:42 osdx dnsmasq[24506]: using nameserver 10::10#53
Oct 30 11:38:42 osdx dnsmasq[24506]: using nameserver 10::2#53
Oct 30 11:38:42 osdx dnsmasq[24506]: read /etc/hosts - 1 addresses
Oct 30 11:38:43 osdx dnsmasq[24506]: query[A] teldat.com from ::1
Oct 30 11:38:43 osdx dnsmasq[24506]: forwarded teldat.com to 10::10
Oct 30 11:38:44 osdx dnsmasq[24506]: query[A] teldat.com from 127.0.0.1
Oct 30 11:38:45 osdx dnsmasq[24506]: query[A] teldat.com from ::1
Oct 30 11:38:45 osdx dnsmasq[24506]: forwarded teldat.com to 10::2
Oct 30 11:38:45 osdx dnsmasq[24506]: reply teldat.com is 172.24.0.11