nslookupで名前解決を行った際にほんの一瞬タイムラグがあり気になっていました。一度名前解決をするとキャッシュされるので気にならなくなるのですが。
いろいろと調べてみるとIPv6が有効になっている時にこの事象が発生するようです。
IPv6が有効になっているかどうかは、ifconfigしてIPv6アドレスが表示されるかどうかで分かります。
# ifconfig -a
eth0: flags=4163 mtu 1500
inet 192.168.10.100 netmask 255.255.255.0 broadcast 192.168.10.255
inet6 2408:210:27e1:1500:215:5dff:fe28:6901 prefixlen 64 scopeid 0x0
inet6 fe80::215:5dff:fe28:6901 prefixlen 64 scopeid 0x20
ether 00:15:5d:28:69:01 txqueuelen 1000 (Ethernet)
RX packets 589519 bytes 175088300 (166.9 MiB)
RX errors 0 dropped 98221 overruns 0 frame 0
TX packets 347008 bytes 96613124 (92.1 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth0: flags=4163
inet 192.168.10.100 netmask 255.255.255.0 broadcast 192.168.10.255
inet6 2408:210:27e1:1500:215:5dff:fe28:6901 prefixlen 64 scopeid 0x0
inet6 fe80::215:5dff:fe28:6901 prefixlen 64 scopeid 0x20
ether 00:15:5d:28:69:01 txqueuelen 1000 (Ethernet)
RX packets 589519 bytes 175088300 (166.9 MiB)
RX errors 0 dropped 98221 overruns 0 frame 0
TX packets 347008 bytes 96613124 (92.1 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
inet6の項目が表示されたのであればIPv6が有効になっている証拠です。ということでIPv6を無効化してしまいます。
まずは/etc/sysctl.d/disable_ipv6.confというファイルを作成します。
net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1
そして設定を反映します。
# sysctl -p /etc/sysctl.d/disable_ipv6.conf
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
#
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
#
ifconfig -a をしてみると、
# ifconfig -a
eth0: flags=4163 mtu 1500
inet 192.168.10.100 netmask 255.255.255.0 broadcast 192.168.10.255
ether 00:15:5d:28:69:01 txqueuelen 1000 (Ethernet)
RX packets 593616 bytes 175831937 (167.6 MiB)
RX errors 0 dropped 98832 overruns 0 frame 0
TX packets 349521 bytes 96958702 (92.4 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth0: flags=4163
inet 192.168.10.100 netmask 255.255.255.0 broadcast 192.168.10.255
ether 00:15:5d:28:69:01 txqueuelen 1000 (Ethernet)
RX packets 593616 bytes 175831937 (167.6 MiB)
RX errors 0 dropped 98832 overruns 0 frame 0
TX packets 349521 bytes 96958702 (92.4 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
これで若干あったタイムラグが解消されました。めでたしめでたし。
Copyright © 2017 蒲田ネット All Rights Reserved.