Check if AVAHI is installed:

/etc/init.d/avahi-daemon status

if not installed:

sudo apt-get install avahi-daemon

Make a service:

sudo insserv avahi-daemon

Create config file:

sudo nano /etc/avahi/services/multiple.service

Insert the following into the file:

<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
        <name replace-wildcards="yes">%h</name>
        <service>
                <type>_device-info._tcp</type>
                <port>0</port>
                <txt-record>model=RackMac</txt-record>
        </service>
        <service>
                <type>_ssh._tcp</type>
                <port>22</port>
        </service>
</service-group>

Save and exit editor.

Restart avahi-daemon:

sudo /etc/init.d/avahi-daemon restart

To access from Windows

Install bonjour on windows system. http://support.apple.com/kb/DL999

Usage:

To ping a device with hostname = 'raspberrypi'

ping rasbperrypi.local