Raspberry Pi Adventures

Join me on my fun ride

Connect To Rasspberry Pi using Hostname


Using OS : 2012-08-16-wheezy-raspbian

After a lot of reading and lot of ups and down finally got this thing to work

Follow these Steps

1. Install Samba
$sudo apt-get install samba

2. Install Winbind
$sudo apt-get install winbind

3. In /etc/samba/smb.conf, Edit the workgroup variable to match your home network workgroup (as defined in windows):
workgroup = HOMENETWORK

4. In /etc/nsswitch.conf, change the following line:

hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4

hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 wins

Note: The extra wins added in the end.
Note: files, dns and wins are the important entries here.
Note: The order of files, dns and wins is important.

Installing samba makes it work Windows to Linux
Installing winbind and changing the config files makes it work Linux to Windows.

All Credits To : Darkness on Raspberry Pi Forum for this suggestion.
Read More : Raspberry Pi • View topic – Debian DHCP configuration

There are various guides online that suggest us to add the “send host-name “mypiname“;” line to /etc/dhcp/dhclient.conf
but this somehow never worked for me only the above mentioned steps works perfectly.

Enjoy 🙂

Raspberry Pi • View topic – Debian DHCP configuration
Linux change my hostname / computer system name
Configuring Linux Static DHCP Clients by Sending Host Name
Send hostname to DHCP server on Ubuntu/XUbuntu | Lucid Tips

Author: Sanket Sonavane

Sanket Sonavane Senior Developer, IoT Enthusiast, Photographer, Bike Rider, Chef, AndroidUser, MacOSX Fanatic ;) Loves computers, programming, web developement, micro-controllers, gadgets, automation and many more such tech innovations that defines the way we live in the modern age and likes to explore what more can be done to help the human race :)

9 thoughts on “Connect To Rasspberry Pi using Hostname

  1. Pingback: Ping raspberry pi from windows box | AWM

  2. It’s awesome in favor of me to have a site, which is beneficial in support of my
    experience. thanks admin

  3. Superb, what a weblog it is! This weblog presents valuable information to us, keep it up.

  4. this is the only good instruction which worked for me, all of the others I found failed.

  5. These instructions did not work for me. I have a Windows 7 computer, and would like to be able to open a web browser to my Rasberry PI’s web server (eg http://raspberrypi.local).
    Even trying to ping raspberrypi.local from the windows machine after following these instructions did not work.

  6. Pratik is correct, instructions are incorrect
    line is only ‘hosts: files dns’ after install. I did not change anything, and this process worked fine.

    Also, did NOT install winbind as I see no point. By default, the Pi can connect to a Windows share under the Raspian image.

    I came here only seeking a way to get my router to recognize the name of the device, was “unknown” forcing me to connect by IP and likely needing static ip over time. With a named ip in the router, I could continue using dhcp, for me it is desired for the project.

    I also commented out most settings in /etc/samba/smb.conf after [global]. Since I do not actually want a server, I dropped logs (preserve the SD) and printers, among others.

    Further, since I do not need to browse the Pi from another computer, I commented out the smbdaemon from running in the etc/init.d/samba boot script.

    Host name shows in the router, I can SSH by name and thus use dhcp. No access to the pi via samba.

  7. There isn’t
    ‘hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4’
    in there!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s