1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Raspberry Pi へ Windows からホスト名でアクセスできない (mDNS が動かない)

Last updated at Posted at 2022-03-15

タイトル通りですがメモです。

Raspberry Pi Imager などで Raspberry Pi の名前を設定して起動するとネットワークなどの設定無し (zeroconf) で ssh などで設定した名前を使用しアクセスできるはずです。これは Raspberry Pi の名前を解決するのに mDNS/Bonjour (RFC 6763) という技術を使っているからです。

しかしこれがたまに動かない場合があります。個人的な使用範囲だと VNC Viewer でアクセスできない時が多いです。ping も動かない時は何故か動きません。

最近の Windows 10 なら mDNS/Bonjour は動くはずなんですが結論としては iTunes をインストールするのが良いようです。iTuens はインストールせず Bonjour だけインストールする という方法もあるようです。

因みに Wireshark で見るとまず DNS に問い合わせをして名前が見つからない場合に IPv4 と IPv6 の UDP マルチキャストでパケットを投げて返答をもらう仕組みのようです。通信を見るのに例えば c4labs.local という名前なら以下のようなフィルターが使用できます。

dns.qry.name == "c4labs.local" or dns.resp.name == "c4labs.local"

正常に動作している場合は以下のように見えます。最後に Standard query response というのが Raspberry Pi (10.185.2.201) からやはり UDP マルチキャストで返ってきています。

5062	2022-03-15 14:49:38.213920	10.185.2.236	55205	10.185.1.3	53	DNS	72		Standard query 0x4b6a A c4labs.local
5063	2022-03-15 14:49:38.217330	10.185.1.3	53	10.185.2.236	55205	DNS	72		Standard query response 0x4b6a No such name A c4labs.local
5065	2022-03-15 14:49:38.218104	10.185.2.236	5353	224.0.0.251	5353	MDNS	72		Standard query 0x0000 A c4labs.local, "QM" question
5066	2022-03-15 14:49:38.218431	ipv6:addr:xxxx:xxxx:xxxx:xxxx	5353	ff02::fb	5353	MDNS	92		Standard query 0x0000 A c4labs.local, "QM" question
5071	2022-03-15 14:49:38.262336	10.185.2.201	5353	224.0.0.251	5353	MDNS	82		Standard query response 0x0000 A, cache flush 10.185.2.201

正常ではない場合のキャプチャは確認できませんでした。もしかするとパケットキャプチャのレベルでは動いているように見えるのかもです。。

参照:
マルチキャストDNS

mDNSメッセージは以下のアドレスに送信されるマルチキャストUDPパケットである。

  • IPv4アドレス 224.0.0.251 または IPv6アドレス ff02::fb
1
0
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?