Armadilloフォーラム

Debian環境で名前解決が出来ない

sachicq

2018年1月16日 19時41分

Armadillo-IoT 上に Debian GNU/Linux を構築、Armadillo-IoTで3G接続はできているが、ホスト名指定でのアクセスができません。

DNSサーバの設定は以下となっています。

root@debian:~# cat /etc/resolv.conf
domain IFX_CDCECM
search IFX_CDCECM
nameserver 100.127.0.53
nameserver 100.127.1.53

DNSサーバにpingは通ります。

root@debian:~# ping 100.127.0.53
PING 100.127.0.53 (100.127.0.53) 56(84) bytes of data.
From 10.0.0.14 icmp_seq=1 Destination Host Unreachable

iptabes --Lコマンドを実行

root@debian:~# iptables --L
iptables v1.4.14: unknown option "--L"

DNSサーバの53番ポートからの接続のみを受け付けるようにする

root@debian:~# iptables -A INPUT -p udp --sport 53 -j ACCEPT

再度ping実行しても名前解決出来ない

root@debian:~# ping google.com
ping: unknown host google.com

解決方法ご教示お願いいたします。

コメント

at_mizo

2018年1月17日 8時50分

溝渕です。

> DNSサーバにpingは通ります。
>
> root@debian:~# ping 100.127.0.53
> PING 100.127.0.53 (100.127.0.53) 56(84) bytes of data.
> From 10.0.0.14 icmp_seq=1 Destination Host Unreachable

上記、pingが通っていません。

gateway設定等に間違いはありませんか?routeコマンド等で確認してみてください。

sachicq

2018年1月17日 19時46分

すいません ping通ってませんでしたね。

一度有線LANでつないだあとに、bootしたらgateway設定が自動でされたようで、3G でも名前解決できるようになりました。

sachicq

2018年1月18日 19時39分

今日再度試してみると、有線LANでも3Gでも名前解決できなくなってしましました。

root@debian:~# cat /etc/resolv.conf
domain IFX_CDCECM
search IFX_CDCECM
nameserver 100.127.0.53
nameserver 100.127.1.53

root@debian:~# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 10.0.0.1 0.0.0.0 UG 0 0 0 eth0
10.0.0.0 * 255.255.255.0 U 0 0 0 eth0
10.0.0.0 * 255.0.0.0 U 0 0 0 umts0

pingも通らない

root@debian:~# ping 100.27.1.53
PING 100.27.1.53 (100.27.1.53) 56(84) bytes of data.
^C
--- 100.27.1.53 ping statistics ---
73 packets transmitted, 0 received, 100% packet loss, time 72007ms

解決方法ご教示お願いいたします。

at_mizo

2018年1月19日 9時04分

溝渕です。

> 今日再度試してみると、有線LANでも3Gでも名前解決できなくなってしましました。

昨日はできたけど、今日はできなくなったという理解で良いでしょうか?

Armadillo-IoTのネットワーク設定やネットワーク環境に、昨日と今日で違い
があれば教えてください。

sachicq

2018年1月20日 15時57分

Armadillo-IoTのネットワーク設定やネットワーク環境は何もいじっていないのですが、なぜかネットワークに接続できていなかったようです。
ネットワーク接続を確認してみると名前解決も問題無くできました。

root@debian:~# cat /etc/resolv.conf
domain IFX_CDCECM
search IFX_CDCECM
nameserver 100.127.0.53
nameserver 100.127.1.53

root@debian:~# ping google.com
PING google.com (172.217.26.46) 56(84) bytes of data.
64 bytes from nrt12s17-in-f14.1e100.net (172.217.26.46): icmp_req=1 ttl=54 time=111 ms
64 bytes from nrt12s17-in-f14.1e100.net (172.217.26.46): icmp_req=2 ttl=54 time=109 ms
64 bytes from nrt12s17-in-f14.1e100.net (172.217.26.46): icmp_req=3 ttl=54 time=108 ms

これは、よかったのですがapt-get updateが途中で止まってしまうようです。

root@debian:~# apt-get update
Get:1 http://security.debian.org wheezy/updates Release.gpg [1601 B]
Get:2 http://security.debian.org wheezy/updates Release [39.0 kB]
Ign http://us.archive.ubuntu.com vivid Release.gpg
Ign http://us.archive.ubuntu.com vivid Release
Hit http://download.atmark-techno.com wheezy Release.gpg
Hit http://download.atmark-techno.com wheezy Release
Hit http://ftp.jp.debian.org wheezy Release.gpg
Get:3 http://security.debian.org wheezy/updates/main Sources [335 kB]
Hit http://ftp.jp.debian.org wheezy Release
Hit http://download.atmark-techno.com wheezy/main armel Packages
Hit http://download.atmark-techno.com wheezy/contrib armel Packages
Hit http://download.atmark-techno.com wheezy/non-free armel Packages
Hit http://security.debian.org wheezy/updates/contrib Sources
Hit http://security.debian.org wheezy/updates/non-free Sources
Get:4 http://security.debian.org wheezy/updates/main armel Packages [594 kB]
Ign http://download.atmark-techno.com wheezy/contrib Translation-en
Ign http://download.atmark-techno.com wheezy/main Translation-en
Ign http://download.atmark-techno.com wheezy/non-free Translation-en
Err http://us.archive.ubuntu.com vivid/main armel Packages
404 Not Found [IP: 91.189.91.23 80]
Hit http://security.debian.org wheezy/updates/contrib armel Packages
Hit http://security.debian.org wheezy/updates/non-free armel Packages
Err http://us.archive.ubuntu.com vivid/universe armel Packages
404 Not Found [IP: 91.189.91.23 80]
Hit http://security.debian.org wheezy/updates/contrib Translation-en
Ign http://us.archive.ubuntu.com vivid/main Translation-en
Ign http://security.debian.org wheezy/updates/main Translation-en
Ign http://security.debian.org wheezy/updates/non-free Translation-en
Ign http://us.archive.ubuntu.com vivid/universe Translation-en
Get:5 http://ftp.jp.debian.org wheezy/main Sources [5993 kB]
Get:6 http://ftp.jp.debian.org wheezy/main armel Packages [5710 kB]
Get:7 http://ftp.jp.debian.org wheezy/contrib armel Packages [34.0 kB]
Get:8 http://ftp.jp.debian.org wheezy/non-free armel Packages [57.7 kB]
Get:9 http://ftp.jp.debian.org wheezy/contrib Translation-en [34.8 kB]
Get:10 http://ftp.jp.debian.org wheezy/main Translation-en [3846 kB]
Get:11 http://ftp.jp.debian.org wheezy/non-free Translation-en [66.1 kB]
Err http://ftp.jp.debian.org wheezy/contrib Sources
406 Not Acceptable
Err http://ftp.jp.debian.org wheezy/non-free Sources
406 Not Acceptable
100% [6 Packages bzip2 0 B]

何が問題なのかご教示いただけるでしょうか?

at_mizo

2018年1月22日 9時09分

溝渕です。

> これは、よかったのですがapt-get updateが途中で止まってしまうようです。

恐らくAPTの取得元リスト(/etc/apt/sources.list)を編集していると思います。
まず、標準のDebian GNU/Linux 7(wheezy)ユーザーランドで動作確認をして
みていただけますか。

sachicq

2018年1月22日 17時29分

ご指摘の様に最後に追加していた一項目をコメントアウトしてみたのですが、やはりupdateできません。。

root@debian:~# cat /etc/apt/sources.list
deb http://ftp.jp.debian.org/debian/ wheezy main contrib non-free
deb-src http://ftp.jp.debian.org/debian/ wheezy main contrib non-free

deb http://security.debian.org/ wheezy/updates main contrib non-free
deb-src http://security.debian.org/ wheezy/updates main contrib non-free

deb http://download.atmark-techno.com/debian/ wheezy main contrib non-free
#deb http://us.archive.ubuntu.com/ubuntu vivid main universe

root@debian:~# apt-get update
Hit http://security.debian.org wheezy/updates Release.gpg
Hit http://download.atmark-techno.com wheezy Release.gpg
Hit http://ftp.jp.debian.org wheezy Release.gpg
Hit http://download.atmark-techno.com wheezy Release
Hit http://ftp.jp.debian.org wheezy Release
Hit http://security.debian.org wheezy/updates Release
Hit http://download.atmark-techno.com wheezy/main armel Packages
Hit http://download.atmark-techno.com wheezy/contrib armel Packages
Hit http://download.atmark-techno.com wheezy/non-free armel Packages
Hit http://ftp.jp.debian.org wheezy/main Sources
Hit http://ftp.jp.debian.org wheezy/main armel Packages
Hit http://ftp.jp.debian.org wheezy/contrib armel Packages
Hit http://ftp.jp.debian.org wheezy/non-free armel Packages
Hit http://ftp.jp.debian.org wheezy/contrib Translation-en
Hit http://ftp.jp.debian.org wheezy/main Translation-en
Hit http://security.debian.org wheezy/updates/main Sources
Hit http://ftp.jp.debian.org wheezy/non-free Translation-en
Ign http://download.atmark-techno.com wheezy/contrib Translation-en
Hit http://security.debian.org wheezy/updates/contrib Sources
Ign http://download.atmark-techno.com wheezy/main Translation-en
Err http://ftp.jp.debian.org wheezy/contrib Sources
406 Not Acceptable
Hit http://security.debian.org wheezy/updates/non-free Sources
Ign http://download.atmark-techno.com wheezy/non-free Translation-en
Err http://ftp.jp.debian.org wheezy/non-free Sources
406 Not Acceptable
Hit http://security.debian.org wheezy/updates/main armel Packages
Hit http://security.debian.org wheezy/updates/contrib armel Packages
Hit http://security.debian.org wheezy/updates/non-free armel Packages
Hit http://security.debian.org wheezy/updates/contrib Translation-en
Hit http://security.debian.org wheezy/updates/main Translation-en
Ign http://security.debian.org wheezy/updates/non-free Translation-en
W: Failed to fetch http://ftp.jp.debian.org/debian/dists/wheezy/contrib/source/Sources 406 Not Acceptable

W: Failed to fetch http://ftp.jp.debian.org/debian/dists/wheezy/non-free/source/Sources 406 Not Acceptable

E: Some index files failed to download. They have been ignored, or old ones used instead.

何がいけないのでしょうか??

at_mizo

2018年1月23日 8時47分

溝渕です。

ftp.jp.debian.orgから、一部component(contribとnon-free)のソースが取得できないようです。APTの取得元リストからdeb-srcの該当componentを外すことで警告/エラーは無くなると思います。

ちなみにミラーに問題は無さそうなので、ネットワーク設定に問題がある可能性もあります。プロキシ設定をしていたりしますか?

sachicq

2018年1月23日 23時29分

プロキシ設定はしていません。

お騒がせしましたが、キャッシュを片っ端から消す、というのをやってみたらなんかエラー出なくなりました。

$ sudo rm -rf /var/lib/apt/lists/*
$ sudo apt-get autoclean
$ sudo apt-get clean