Ticker

6/recent/ticker-posts

Assign static local domain to Raspberry Pi

In my previous examples about ssh, vnc, I always have to check the IP address (192.168.xxx.xxx) of my Raspberry Pi locally with ifconfig, or login my router to look-up the connected IPs; because it will change dynamically. By assigning a static local domain to Raspberry Pi with avahi-daemon, I can use a local domain such as raspberrypi.local consistently.



Steps:

If you have computers running Apple’s OS X on your network, it already support it.
If you run on Windows, you have to install Bonjour Print Services for Windows.

In Raspberry Pi side, enter the command:
sudo apt-get install avahi-daemon
sudo insserv avahi-daemon

Create a configfile for Avahi at /etc/avahi/services/multiple.service, with the command:
sudo pico /etc/avahi/services/multiple.service

with content of:



%h

_device-info._tcp
0
model=local


_ssh._tcp
22



then run the command:
sudo /etc/init.d/avahi-daemon restart

The local domain name of your Raspberry Pi will be .local, such as:
raspberrypi.local

After a moment, you can access Raspberry Pi with its new static domain.

Video demo:

reference:
http://elinux.org/RPi_Advanced_Setup

إرسال تعليق

0 تعليقات