OSX provides the ability to access a computer on the LAN by its hostname plus .local. This feature, provided initially by Apple Bonjour, is also available on Linux thanks to Avahi.

Indeed, Avahi is a *nix daemon that implements a series of specifications that allow computers to share services without configuration servers. This set of technologies are also known as Zeroconf.

Installing Avahi is easy because it is available on almost all package managers.

On Debian/Ubuntu
sudo apt-get install avahi-daemon

Once Avahi gets installed, you can configure it manually by adding services. To do so, you need to create a file with extension .service inside /etc/avahi/services.

This is an example of SSH service file to access the computer’s SSH by typing ssh user@hostname.local:

/etc/avahi/services/ssh.service
<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
    <name replace-wildcards="yes">%h</name>
    <service>
        <type>_ssh._tcp</type>
        <port>22</port>
    </service>
 </service-group>

This is another example of service file. Add this if you want to access the machine web server by typing http://hostname.local in a browser.

/etc/avahi/services/http.service
<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
    <name replace-wildcards="yes">%h</name>
    <service>
        <type>_http._tcp</type>
        <port>80</port>
    </service>
 </service-group>

However, there is one big catch: the compatibility. Zeroconf technologies are not provided on Windows and Android.

On Windows, a solution is the proprietary implementation, Bonjour, which is available through the iTunes app. You can install Bonjour alone by extracting Bonjour64.msi from the iTunes executable.

On mobile, iOS supports Zeroconf out of the box but unfortunately there is no solution for Android yet (even in Lollipop). There are few apps that are able to discover Zeroconf services, but Chrome (or any other browser) will not be able to resolve http://hostname.local anyway.

For more examples of services check out the Archlinux Wiki.