Friday, November 8, 2013

Assign static local domain to Raspberry Pi

In my previous examples about ssh, vnc, I always have to check the IP address ( 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.


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:
<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
        <name replace-wildcards="yes">%h</name>

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

The local domain name of your Raspberry Pi will be <Raspberry Pi host name>.local, such as:

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

Video demo:


No comments: