LoginSignup
20
23

More than 5 years have passed since last update.

Raspberry Pi にホスト名でアクセス出来るようにする

Last updated at Posted at 2015-09-14

DHCPだと毎回IP変わるし、持ち運ぶので固定IPはちょっと、という場合に便利です。
hostsファイルは使わずにavahiを使います。(Macでいうbonjour機能らしい)

sudo apt-get install avahi-daemon 

/etc/hostnameに記述した名前 + .localでアクセスできるようになります。

ssh pi@trapple-no-pi.local

[追記]sudoすると警告がでる

sudoで作業をすると以下のようなエラーがでてしまいました。

sudo: ホスト trapple-no-pi の名前解決ができません

/etc/hostsを編集します。

127.0.1.1       trapple-no-pi

警告がでなくなりました。
反映されないようならsudo rebootしてみましょう。


参考

http://qiita.com/kasei-san/items/087e5b33207c214c8db6
http://daisukekmr.hatenablog.com/entry/20150118/1421556642

20
23
0

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
20
23