LoginSignup
4
1

/etc/resolv.confのタイムアウト値検証

Last updated at Posted at 2023-12-04

1. はじめに

Linux環境において、もし/etc/resolv.confに登録したnameserverが応答しなかった場合に、どれぐらいの時間で次のnameserverに切り替わるのかについて興味を持ったので、検証してみた。なお、Windowsだと以下のような仕組みになる。
https://learn.microsoft.com/ja-jp/troubleshoot/windows-server/networking/dns-client-resolution-timeouts

結論から言うと以下のように構成しておくことが推奨である。

  • /etc/resolv.confに構成するnameserverは(冗長化のために)最低2つは設定しておく。
  • nameserverからのICMP port unreachableを受け取るようにしておく。デフォルトのタイムアウトは5秒だが、もしnameserverから送信されるICMP port unreachableを受け取ることができれば、そのタイムアウトを待つことなく次のnameserverを試行できる。(特に、クラウド環境ではnameserverへの通信は許可していても、nameserverからのinbound通信まで許可していないことも多い気がする)。

2. タイムアウト値のロジック

  • /etc/resolv.confに名前解決に利用するnameserverを最大3台まで登録することが可能。4台目以降は無視される。
man resolv.confの結果より引用
       nameserver Name server IP address
              Internet address of a name server that the resolver should query, either an IPv4 address (in dot notation), or an IPv6 address in colon (and possibly dot) notation
              as  per  RFC  2373.   Up  to  MAXNS (currently 3, see <resolv.h>) name servers may be listed, one per keyword.  If there are multiple servers, the resolver library
              queries them in the order listed.  If no nameserver entries are present, the default is to use the name server on the local machine.  (The algorithm used is to try
              a  name  server, and if the query times out, try the next, until out of name servers, then repeat trying all the name servers until a maximum number of retries are
              made.)

  • 設定したnameserverを利用して、登録した順に上から順に名前解決を試行する。名前解決に失敗した場合は次のnameserverを利用する。こうしてこれらのリストを複数回巡回する。
- デフォルトでは2巡する。
- 何巡するかを指定する設定値が`options attempts:n`
- 以下はman resolv.confの結果より引用
              attempts:n
                     sets the number of times the resolver will send a query to its name servers before giving up and returning an error to the calling application.  The default
                     is RES_DFLRETRY (currently 2, see <resolv.h>).  The value for this option is silently capped to 5.
  • 1台目のnameserverへの名前解決リクエストのタイムアウト値
- デフォルトは5秒。
- 1台目の名前解決リクエストのtimeout値を指定する設定値が`options timeout:n`
- エラーになるか、このタイムアウト値が過ぎても結果が返ってこない場合は、次のnameserverを利用する。
- 以下はman resolv.confの結果より引用
              timeout:n
                     sets  the amount of time the resolver will wait for a response from a remote name server before retrying the query via a different name server.  Measured in
                     seconds, the default is RES_TIMEOUT (currently 5, see <resolv.h>).  The value for this option is silently capped to 30.
  • 2台目のnameserverへの名前解決リクエストのタイムアウト値
 (timeout値)*2/(resolv.confに登録したnameserverの数)
もしtimeout値がデフォルトから変更していない場合は、
        - nameserver 2台登録時:  5秒 * 2 / 2台 = 5秒
        - nameserver 3台登録時:  5秒 * 2 / 3台 = 3秒 (小数点以下は切り捨て)
  • 3台目のnameserverへの名前解決リクエストのタイムアウト値
[2台目のnameserverへの名前解決リクエストのタイムアウト値] * 2
もしtimeout値がデフォルトから変更していない場合は、
    - 3秒 * 2  = 6秒

3. 検証のまとめ

timeoutの時間と、最終的にクライアントにエラーが返るまでの時間

nameserverの番号 検証1
デフォルト値
nameserver 1台
検証2
デフォルト値
nameserver 2台
検証3
デフォルト値
name server 3台
検証4
デフォルト値
name server 2台
ただし1台目がNW的に疎通可能でクライアントがICMPを受け取れる場合
検証5
デフォルト値
name server 3台。
ただし1台目がNW的に疎通可能でクライアントがICMPを受け取れる場合
検証6
カスタム値(timeout=1, attempts=3)
name server 2台
検証7
カスタム値(timeout=1, attempts=3)
name server 3台
1台目 5 5 5 5。ただし、timeoutを待つことなく次のnameserverを利用 5。ただし、timeoutを待つことなく次のnameserverを利用 1 1
2台目 - 5 3 5 3 1 1
3台目 - - 6 - 6 - 1
1台目 5 5 5 (5秒待つ必要がない) (5秒待つ必要がない) 1 1
2台目 - 5 3 5 3 1 1
3台目 - - 6 - 6 - 1
1台目 - - - - - 1 1
2台目 - - - - - 1 1
3台目 - - - - - - 1
合計(最終的にクライアントにエラーが返るまでの時間) 10 20 28 10 18 6 9

4. 検証詳細

検証1: デフォルト値 + nameserver 1台

/etc/resolv.conf
; generated by /usr/sbin/dhclient-script
nameserver 10.100.0.10
[root@new-syasuda-tok1-vpc1 ~]# time curl https://www.yahoo.co.jp
curl: (6) Could not resolve host: www.yahoo.co.jp; Unknown error

real	0m10.525s
user	0m0.000s
sys	    0m0.006s
[root@new-syasuda-tok1-vpc1 ~]# tcpdump -i any port 53 -nn
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on any, link-type LINUX_SLL (Linux cooked), capture size 262144 bytes
10:31:01.259131 IP 10.0.0.4.59255 > 10.100.0.10.53: 61036+ A? www.yahoo.co.jp. (33)
10:31:01.259152 IP 10.0.0.4.59255 > 10.100.0.10.53: 56443+ AAAA? www.yahoo.co.jp. (33)
10:31:06.264283 IP 10.0.0.4.59255 > 10.100.0.10.53: 61036+ A? www.yahoo.co.jp. (33)
10:31:06.264359 IP 10.0.0.4.59255 > 10.100.0.10.53: 56443+ AAAA? www.yahoo.co.jp. (33)

[1巡目: 5秒] -> [2巡目: 5秒]

検証2: デフォルト値 + nameserver 2台

/etc/resolv.conf
; generated by /usr/sbin/dhclient-script
nameserver 10.100.0.10
nameserver 10.101.0.10
[root@new-syasuda-tok1-vpc1 ~]# time curl https://www.yahoo.co.jp
curl: (6) Could not resolve host: www.yahoo.co.jp; Unknown error

real	0m20.536s
user	0m0.004s
sys	    0m0.003s
[root@new-syasuda-tok1-vpc1 ~]# tcpdump -i any port 53 -nn
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on any, link-type LINUX_SLL (Linux cooked), capture size 262144 bytes
10:32:21.574002 IP 10.0.0.4.56938 > 10.100.0.10.53: 20993+ A? www.yahoo.co.jp. (33)
10:32:21.574030 IP 10.0.0.4.56938 > 10.100.0.10.53: 9233+ AAAA? www.yahoo.co.jp. (33)
10:32:26.579211 IP 10.0.0.4.43173 > 10.101.0.10.53: 20993+ A? www.yahoo.co.jp. (33)
10:32:26.579285 IP 10.0.0.4.43173 > 10.101.0.10.53: 9233+ AAAA? www.yahoo.co.jp. (33)
10:32:31.584434 IP 10.0.0.4.56938 > 10.100.0.10.53: 20993+ A? www.yahoo.co.jp. (33)
10:32:31.584512 IP 10.0.0.4.56938 > 10.100.0.10.53: 9233+ AAAA? www.yahoo.co.jp. (33)
10:32:36.589658 IP 10.0.0.4.43173 > 10.101.0.10.53: 20993+ A? www.yahoo.co.jp. (33)
10:32:36.589734 IP 10.0.0.4.43173 > 10.101.0.10.53: 9233+ AAAA? www.yahoo.co.jp. (33)

[1巡目: 5秒 -> 5秒] -> [2巡目: 5秒 -> 5秒]

検証3: デフォルト値 + nameserver 3台

/etc/resolv.conf
; generated by /usr/sbin/dhclient-script
nameserver 10.100.0.10
nameserver 10.101.0.10
nameserver 10.102.0.10
[root@new-syasuda-tok1-vpc1 ~]# time curl https://www.yahoo.co.jp
curl: (6) Could not resolve host: www.yahoo.co.jp; Unknown error

real	0m28.545s
user	0m0.003s
sys	    0m0.004s
[root@new-syasuda-tok1-vpc1 ~]# tcpdump -i any port 53 -nn
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on any, link-type LINUX_SLL (Linux cooked), capture size 262144 bytes
10:33:39.013626 IP 10.0.0.4.42809 > 10.100.0.10.53: 20513+ A? www.yahoo.co.jp. (33)
10:33:39.013670 IP 10.0.0.4.42809 > 10.100.0.10.53: 37423+ AAAA? www.yahoo.co.jp. (33)
10:33:44.018876 IP 10.0.0.4.51905 > 10.101.0.10.53: 20513+ A? www.yahoo.co.jp. (33)
10:33:44.018955 IP 10.0.0.4.51905 > 10.101.0.10.53: 37423+ AAAA? www.yahoo.co.jp. (33)
10:33:47.022153 IP 10.0.0.4.48117 > 10.102.0.10.53: 20513+ A? www.yahoo.co.jp. (33)
10:33:47.022228 IP 10.0.0.4.48117 > 10.102.0.10.53: 37423+ AAAA? www.yahoo.co.jp. (33)
10:33:53.028379 IP 10.0.0.4.42809 > 10.100.0.10.53: 20513+ A? www.yahoo.co.jp. (33)
10:33:53.028453 IP 10.0.0.4.42809 > 10.100.0.10.53: 37423+ AAAA? www.yahoo.co.jp. (33)
10:33:58.033092 IP 10.0.0.4.51905 > 10.101.0.10.53: 20513+ A? www.yahoo.co.jp. (33)
10:33:58.033121 IP 10.0.0.4.51905 > 10.101.0.10.53: 37423+ AAAA? www.yahoo.co.jp. (33)
10:34:01.036248 IP 10.0.0.4.48117 > 10.102.0.10.53: 20513+ A? www.yahoo.co.jp. (33)
10:34:01.036283 IP 10.0.0.4.48117 > 10.102.0.10.53: 37423+ AAAA? www.yahoo.co.jp. (33)

[1巡目: 5秒 -> 3秒 -> 6秒] -> [2巡目: 5秒 -> 3秒 -> 6秒]

検証4 : デフォルト値 + nameserver 2台。ただし、1台目がNW的に疎通可能

これらのアドレスのサーバーとは疎通できない
[root@new-syasuda-tok1-vpc1 ~]# ping 10.100.0.10
PING 10.100.0.10 (10.100.0.10) 56(84) bytes of data.
^C
--- 10.100.0.10 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 1999ms

[root@new-syasuda-tok1-vpc1 ~]# ping 10.101.0.10
PING 10.101.0.10 (10.101.0.10) 56(84) bytes of data.
^C
--- 10.101.0.10 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 1999ms

[root@new-syasuda-tok1-vpc1 ~]# ping 10.102.0.10
PING 10.102.0.10 (10.102.0.10) 56(84) bytes of data.
^C
--- 10.102.0.10 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 1999ms
このアドレスとは疎通している(ただし、DNSサービスは起動していない)
[root@new-syasuda-tok1-vpc1 ~]# ping 10.100.0.4
PING 10.100.0.4 (10.100.0.4) 56(84) bytes of data.
64 bytes from 10.100.0.4: icmp_seq=1 ttl=54 time=9.03 ms
64 bytes from 10.100.0.4: icmp_seq=2 ttl=54 time=8.98 ms
64 bytes from 10.100.0.4: icmp_seq=3 ttl=54 time=9.08 ms

[root@new-syasuda-tok1-vpc1 ~]# nmap -sU 10.100.0.4 -p 53

Starting Nmap 6.40 ( http://nmap.org ) at 2023-12-04 12:22 JST
Nmap scan report for 10.100.0.4
Host is up (0.0090s latency).
PORT   STATE  SERVICE
53/udp closed domain

Nmap done: 1 IP address (1 host up) scanned in 13.46 seconds
/etc/resolv.conf
; generated by /usr/sbin/dhclient-script
nameserver 10.100.0.4
nameserver 10.101.0.10
[root@new-syasuda-tok1-vpc1 ~]# time curl https://www.yahoo.co.jp
curl: (6) Could not resolve host: www.yahoo.co.jp; Unknown error

real	0m10.524s
user	0m0.002s
sys	    0m0.005s
[root@new-syasuda-tok1-vpc1 ~]# tcpdump -i any host 10.100.0.4 or 10.101.0.10 -nn
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on any, link-type LINUX_SLL (Linux cooked), capture size 262144 bytes
12:28:14.099342 IP 10.0.0.4.60012 > 10.100.0.4.53: 37630+ A? www.yahoo.co.jp. (33)
12:28:14.099381 IP 10.0.0.4.60012 > 10.100.0.4.53: 11276+ AAAA? www.yahoo.co.jp. (33)
12:28:14.108349 IP 10.100.0.4 > 10.0.0.4: ICMP 10.100.0.4 udp port 53 unreachable, length 69
12:28:14.108369 IP 10.100.0.4 > 10.0.0.4: ICMP 10.100.0.4 udp port 53 unreachable, length 69
12:28:14.108423 IP 10.0.0.4.54553 > 10.101.0.10.53: 37630+ A? www.yahoo.co.jp. (33)
12:28:14.108435 IP 10.0.0.4.54553 > 10.101.0.10.53: 11276+ AAAA? www.yahoo.co.jp. (33)
12:28:19.113666 IP 10.0.0.4.48083 > 10.100.0.4.53: 37630+ A? www.yahoo.co.jp. (33)
12:28:19.113733 IP 10.0.0.4.48083 > 10.100.0.4.53: 11276+ AAAA? www.yahoo.co.jp. (33)
12:28:19.122761 IP 10.100.0.4 > 10.0.0.4: ICMP 10.100.0.4 udp port 53 unreachable, length 69
12:28:19.122782 IP 10.100.0.4 > 10.0.0.4: ICMP 10.100.0.4 udp port 53 unreachable, length 69
12:28:19.122852 IP 10.0.0.4.40262 > 10.101.0.10.53: 37630+ A? www.yahoo.co.jp. (33)
12:28:19.122867 IP 10.0.0.4.40262 > 10.101.0.10.53: 11276+ AAAA? www.yahoo.co.jp. (33)

ICMP port unreachableを受信したため、1台目のnameserverへの問い合わせタイムアウト(5秒)を待たずに次のnameserverを試行できている。
[1巡目:0秒 -> 5秒 ] -> [2巡目:0秒 -> 5秒]

検証5 : デフォルト値 + nameserver 3台。ただし、1台目がNW的に疎通可能

これらのアドレスのサーバーとは疎通できない
[root@new-syasuda-tok1-vpc1 ~]# ping 10.100.0.10
PING 10.100.0.10 (10.100.0.10) 56(84) bytes of data.
^C
--- 10.100.0.10 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 1999ms

[root@new-syasuda-tok1-vpc1 ~]# ping 10.101.0.10
PING 10.101.0.10 (10.101.0.10) 56(84) bytes of data.
^C
--- 10.101.0.10 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 1999ms

[root@new-syasuda-tok1-vpc1 ~]# ping 10.102.0.10
PING 10.102.0.10 (10.102.0.10) 56(84) bytes of data.
^C
--- 10.102.0.10 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 1999ms
このアドレスとは疎通している(ただし、DNSサービスは起動していない)
[root@new-syasuda-tok1-vpc1 ~]# ping 10.100.0.4
PING 10.100.0.4 (10.100.0.4) 56(84) bytes of data.
64 bytes from 10.100.0.4: icmp_seq=1 ttl=54 time=9.03 ms
64 bytes from 10.100.0.4: icmp_seq=2 ttl=54 time=8.98 ms
64 bytes from 10.100.0.4: icmp_seq=3 ttl=54 time=9.08 ms

[root@new-syasuda-tok1-vpc1 ~]# nmap -sU 10.100.0.4 -p 53

Starting Nmap 6.40 ( http://nmap.org ) at 2023-12-04 12:22 JST
Nmap scan report for 10.100.0.4
Host is up (0.0090s latency).
PORT   STATE  SERVICE
53/udp closed domain

Nmap done: 1 IP address (1 host up) scanned in 13.46 seconds
[root@new-syasuda-tok1-vpc1 ~]# cat /etc/resolv.conf
; generated by /usr/sbin/dhclient-script
nameserver 10.100.0.4
nameserver 10.101.0.10
nameserver 10.102.0.10
[root@new-syasuda-tok1-vpc1 ~]# time curl https://www.yahoo.co.jp
curl: (6) Could not resolve host: www.yahoo.co.jp; Unknown error

real	0m18.533s
user	0m0.003s
sys	    0m0.003s
[root@new-syasuda-tok1-vpc1 ~]# tcpdump -i any host 10.100.0.4 or 10.101.0.10 or 10.102.0.10 -nn
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on any, link-type LINUX_SLL (Linux cooked), capture size 262144 bytes
12:30:11.552947 IP 10.0.0.4.58872 > 10.100.0.4.53: 41705+ A? www.yahoo.co.jp. (33)
12:30:11.552968 IP 10.0.0.4.58872 > 10.100.0.4.53: 19191+ AAAA? www.yahoo.co.jp. (33)
12:30:11.562008 IP 10.100.0.4 > 10.0.0.4: ICMP 10.100.0.4 udp port 53 unreachable, length 69
12:30:11.562029 IP 10.100.0.4 > 10.0.0.4: ICMP 10.100.0.4 udp port 53 unreachable, length 69
12:30:11.562096 IP 10.0.0.4.33203 > 10.101.0.10.53: 41705+ A? www.yahoo.co.jp. (33)
12:30:11.562146 IP 10.0.0.4.33203 > 10.101.0.10.53: 19191+ AAAA? www.yahoo.co.jp. (33)
12:30:14.565361 IP 10.0.0.4.50966 > 10.102.0.10.53: 41705+ A? www.yahoo.co.jp. (33)
12:30:14.565395 IP 10.0.0.4.50966 > 10.102.0.10.53: 19191+ AAAA? www.yahoo.co.jp. (33)
12:30:20.571566 IP 10.0.0.4.42541 > 10.100.0.4.53: 41705+ A? www.yahoo.co.jp. (33)
12:30:20.571609 IP 10.0.0.4.42541 > 10.100.0.4.53: 19191+ AAAA? www.yahoo.co.jp. (33)
12:30:20.580712 IP 10.100.0.4 > 10.0.0.4: ICMP 10.100.0.4 udp port 53 unreachable, length 69
12:30:20.580734 IP 10.100.0.4 > 10.0.0.4: ICMP 10.100.0.4 udp port 53 unreachable, length 69
12:30:20.580807 IP 10.0.0.4.42017 > 10.101.0.10.53: 41705+ A? www.yahoo.co.jp. (33)
12:30:20.580822 IP 10.0.0.4.42017 > 10.101.0.10.53: 19191+ AAAA? www.yahoo.co.jp. (33)
12:30:23.584023 IP 10.0.0.4.43102 > 10.102.0.10.53: 41705+ A? www.yahoo.co.jp. (33)
12:30:23.584086 IP 10.0.0.4.43102 > 10.102.0.10.53: 19191+ AAAA? www.yahoo.co.jp. (33)

ICMP port unreachableを受信したため、1台目のnameserverへの問い合わせタイムアウト(5秒)を待たずに次のnameserverを試行できている。
[1巡目:0秒 -> 3秒 -> 6秒] -> [2巡目:0秒 -> 3秒 -> 6秒]

検証6: カスタム値(timeout=1, attempts=3): nameserver 2台

/etc/resolv.conf
; generated by /usr/sbin/dhclient-script
options timeout:1
options attempts:3
nameserver 10.100.0.10
nameserver 10.101.0.10
[root@new-syasuda-tok1-vpc1 ~]# time curl https://www.yahoo.co.jp
curl: (6) Could not resolve host: www.yahoo.co.jp; Unknown error

real	0m6.521s
user	0m0.003s
sys	    0m0.004s
[root@new-syasuda-tok1-vpc1 ~]# tcpdump -i any port 53 -nn
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on any, link-type LINUX_SLL (Linux cooked), capture size 262144 bytes
11:25:01.505679 IP 10.0.0.4.49839 > 10.100.0.10.53: 6256+ A? www.yahoo.co.jp. (33)
11:25:01.505724 IP 10.0.0.4.49839 > 10.100.0.10.53: 24194+ AAAA? www.yahoo.co.jp. (33)
11:25:02.507034 IP 10.0.0.4.47391 > 10.101.0.10.53: 6256+ A? www.yahoo.co.jp. (33)
11:25:02.507182 IP 10.0.0.4.47391 > 10.101.0.10.53: 24194+ AAAA? www.yahoo.co.jp. (33)
11:25:03.508390 IP 10.0.0.4.49839 > 10.100.0.10.53: 6256+ A? www.yahoo.co.jp. (33)
11:25:03.508481 IP 10.0.0.4.49839 > 10.100.0.10.53: 24194+ AAAA? www.yahoo.co.jp. (33)
11:25:04.509624 IP 10.0.0.4.47391 > 10.101.0.10.53: 6256+ A? www.yahoo.co.jp. (33)
11:25:04.509723 IP 10.0.0.4.47391 > 10.101.0.10.53: 24194+ AAAA? www.yahoo.co.jp. (33)
11:25:05.510879 IP 10.0.0.4.49839 > 10.100.0.10.53: 6256+ A? www.yahoo.co.jp. (33)
11:25:05.510944 IP 10.0.0.4.49839 > 10.100.0.10.53: 24194+ AAAA? www.yahoo.co.jp. (33)
11:25:06.512101 IP 10.0.0.4.47391 > 10.101.0.10.53: 6256+ A? www.yahoo.co.jp. (33)
11:25:06.512191 IP 10.0.0.4.47391 > 10.101.0.10.53: 24194+ AAAA? www.yahoo.co.jp. (33)

[1巡目:1秒 -> 1秒] -> [2巡目:1秒 -> 1秒] -> [3巡目:1秒 -> 1秒]

検証7: カスタム値(timeout=1, attempts=3): nameserver 3台

/etc/resolv.conf
; generated by /usr/sbin/dhclient-script
options timeout:1
options attempts:3
nameserver 10.100.0.10
nameserver 10.101.0.10
nameserver 10.102.0.10
[root@new-syasuda-tok1-vpc1 ~]# time curl https://www.yahoo.co.jp
curl: (6) Could not resolve host: www.yahoo.co.jp; Unknown error

real	0m9.524s
user	0m0.000s
sys	    0m0.007s
[root@new-syasuda-tok1-vpc1 ~]# tcpdump -i any port 53 -nn
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on any, link-type LINUX_SLL (Linux cooked), capture size 262144 bytes
10:59:25.382054 IP 10.0.0.4.50291 > 10.100.0.10.53: 38014+ A? www.yahoo.co.jp. (33)
10:59:25.382135 IP 10.0.0.4.50291 > 10.100.0.10.53: 24293+ AAAA? www.yahoo.co.jp. (33)
10:59:26.383357 IP 10.0.0.4.55762 > 10.101.0.10.53: 38014+ A? www.yahoo.co.jp. (33)
10:59:26.383388 IP 10.0.0.4.55762 > 10.101.0.10.53: 24293+ AAAA? www.yahoo.co.jp. (33)
10:59:27.384595 IP 10.0.0.4.38501 > 10.102.0.10.53: 38014+ A? www.yahoo.co.jp. (33)
10:59:27.384662 IP 10.0.0.4.38501 > 10.102.0.10.53: 24293+ AAAA? www.yahoo.co.jp. (33)
10:59:28.385767 IP 10.0.0.4.50291 > 10.100.0.10.53: 38014+ A? www.yahoo.co.jp. (33)
10:59:28.385828 IP 10.0.0.4.50291 > 10.100.0.10.53: 24293+ AAAA? www.yahoo.co.jp. (33)
10:59:29.386950 IP 10.0.0.4.55762 > 10.101.0.10.53: 38014+ A? www.yahoo.co.jp. (33)
10:59:29.387000 IP 10.0.0.4.55762 > 10.101.0.10.53: 24293+ AAAA? www.yahoo.co.jp. (33)
10:59:30.388097 IP 10.0.0.4.38501 > 10.102.0.10.53: 38014+ A? www.yahoo.co.jp. (33)
10:59:30.388128 IP 10.0.0.4.38501 > 10.102.0.10.53: 24293+ AAAA? www.yahoo.co.jp. (33)
10:59:31.389280 IP 10.0.0.4.50291 > 10.100.0.10.53: 38014+ A? www.yahoo.co.jp. (33)
10:59:31.389310 IP 10.0.0.4.50291 > 10.100.0.10.53: 24293+ AAAA? www.yahoo.co.jp. (33)
10:59:32.390460 IP 10.0.0.4.55762 > 10.101.0.10.53: 38014+ A? www.yahoo.co.jp. (33)
10:59:32.390512 IP 10.0.0.4.55762 > 10.101.0.10.53: 24293+ AAAA? www.yahoo.co.jp. (33)
10:59:33.391676 IP 10.0.0.4.38501 > 10.102.0.10.53: 38014+ A? www.yahoo.co.jp. (33)
10:59:33.391740 IP 10.0.0.4.38501 > 10.102.0.10.53: 24293+ AAAA? www.yahoo.co.jp. (33)

[1巡目:1秒 -> 1秒 -> 1秒] -> [2巡目:1秒 -> 1秒  -> 1秒] -> [3巡目:1秒 -> 1秒  -> 1秒]

検証8: nameserver4台構成

/etc/resolv.conf
; generated by /usr/sbin/dhclient-script
nameserver 10.100.0.10
nameserver 10.101.0.10
nameserver 10.102.0.10
nameserver 10.103.0.10
[root@new-syasuda-tok1-vpc1 ~]# time curl https://www.yahoo.co.jp
curl: (6) Could not resolve host: www.yahoo.co.jp; Unknown error

real	0m28.545s
user	0m0.004s
sys	    0m0.004s
[root@new-syasuda-tok1-vpc1 ~]# tcpdump -i any port 53 -nn
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on any, link-type LINUX_SLL (Linux cooked), capture size 262144 bytes
10:35:50.798764 IP 10.0.0.4.42290 > 10.100.0.10.53: 6784+ A? www.yahoo.co.jp. (33)
10:35:50.798808 IP 10.0.0.4.42290 > 10.100.0.10.53: 17037+ AAAA? www.yahoo.co.jp. (33)
10:35:55.804015 IP 10.0.0.4.51079 > 10.101.0.10.53: 6784+ A? www.yahoo.co.jp. (33)
10:35:55.804102 IP 10.0.0.4.51079 > 10.101.0.10.53: 17037+ AAAA? www.yahoo.co.jp. (33)
10:35:58.807312 IP 10.0.0.4.52214 > 10.102.0.10.53: 6784+ A? www.yahoo.co.jp. (33)
10:35:58.807355 IP 10.0.0.4.52214 > 10.102.0.10.53: 17037+ AAAA? www.yahoo.co.jp. (33)
10:36:04.813511 IP 10.0.0.4.42290 > 10.100.0.10.53: 6784+ A? www.yahoo.co.jp. (33)
10:36:04.813547 IP 10.0.0.4.42290 > 10.100.0.10.53: 17037+ AAAA? www.yahoo.co.jp. (33)
10:36:09.818623 IP 10.0.0.4.51079 > 10.101.0.10.53: 6784+ A? www.yahoo.co.jp. (33)
10:36:09.818692 IP 10.0.0.4.51079 > 10.101.0.10.53: 17037+ AAAA? www.yahoo.co.jp. (33)
10:36:12.821770 IP 10.0.0.4.52214 > 10.102.0.10.53: 6784+ A? www.yahoo.co.jp. (33)
10:36:12.821837 IP 10.0.0.4.52214 > 10.102.0.10.53: 17037+ AAAA? www.yahoo.co.jp. (33)

4台目のnamserverである10.103.0.10は使われていない。

4
1
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
1