2

According to Debian's RPi3 image wiki, I should be able to ssh into a Raspberry-Pi, with just the hostname. I shared internet from my Debian laptop, WiFi to the a Raspberry-Pi over Ethernet, but the hostname never resolved.

What kind of settings/configuration do either the client and server or the network need for LAN hostname resolution to work?

What do I need to install on the Pi so that MS-Windows can resolve the Pi's IP address when I want to access a web server hosted on it, for example? I think it's smbclient but I'm not sure.

ctrl-alt-delor
  • 27,473
  • 9
  • 58
  • 102
Oxwivi
  • 2,232
  • 4
  • 23
  • 31
  • 2
    They are not saying it is a given. They are saying if you have a local DHCP+DNS server configured in a certain way, it will work by name. You also have zeroconf ; also DNS configurations for more professional setting. `smbclient` if for SMB file shares, has nothing to do with it. Also, for a web server, you do not specify what you want to do with it, and whom is getting into it e.g. what is your goal. – Rui F Ribeiro Jan 05 '19 at 12:48
  • @RuiFRibeiro, I just need the web server to be accessible over the LAN using its hostname. – Oxwivi Jan 05 '19 at 12:59
  • for how many computers? – Rui F Ribeiro Jan 05 '19 at 13:01
  • @RuiFRibeiro, less than 10. It's going be pretty much unmanaged, that's why I'm not considering a DNS which I actually know how to set up. – Oxwivi Jan 05 '19 at 13:17
  • @Oxwivi have you considered using mDNS? – steeling Jan 05 '19 at 13:28
  • While I don't rely know what the question is. I will guess that zero-conf will go it. There is a program called avahi. The server, if installed, will advertise the name of device to the local network. (zero conf is low management, but only for local network). – ctrl-alt-delor Jan 05 '19 at 13:28
  • @ctrl-alt-delor, I was giving an example that despite what's written in the wiki, I couldn't resolve the Pi from my Debian laptop. Windows is the client, where the browser is running that needs to be able to access the web server on Pi. For `zeroconf`, what do I need to set up on Windows and the Linux server? Otherwise, NetBIOS implementation using `samba` sounds viable to me as well. – Oxwivi Jan 05 '19 at 13:40
  • If you don't want to bother with DNS and your DHCP server isn't handling that for you, why not add the Pi to (the equivalent of) `/etc/hosts`? – roaima Jan 05 '19 at 14:04
  • @roaima, there's no restricting whatever device they're going to access it from, and the users aren't exactly tech literate enough to modify their Windows `hosts` file. That is to say, it's not possible for me to edit every devices' `hosts` file whenever a need arises. – Oxwivi Jan 05 '19 at 14:10
  • For around 10 computers IMO, it is already the time to bother having DNS...at least you know it works. You are just assuming stuff, suppose tomorrow someone wants to use an Android or iPhone. If you say you do not know how to setup DNS, I do even understand what you are trying to accomplish here. Trying to find shortcuts not the best of the ideas. – Rui F Ribeiro Jan 05 '19 at 14:59
  • @RuiFRibeiro, I can set up a DNS, but this is a one-off thing, that I'll never be involved in once I'm done setting up. Later if they have issues with any networking device like the router or AP, they're gonna be helpless. Whatever, forget about my specific case, just make an answer how Windows can possibly resolve a Linux server so I can select it and call it a day. – Oxwivi Jan 05 '19 at 17:06
  • The LAN router needs to be configured to serve the local DNS. Then any client can locate the server. The clients don't need any special configuration. – beginner6789 Jan 06 '19 at 02:05

1 Answers1

2

Enable Link-Local Multicast Name Resolution (LLMNR) on the RPi. Edit /etc/systemd/resolved.conf and set LLMNR=true. Enable and start the systemd service system-resolved: systemctl --now enable systemd-resolved. No DNS server is needed, but name resolution only works on the local net. Make sure there are no duplicate hostnames on the LAN.

Johan Myréen
  • 12,862
  • 1
  • 32
  • 33
  • `resolved` won't conflict with `NetworkManager` that's managing everything by default right? If it doesn't, I'll just uncomment the `LLMNR` line. – Oxwivi Jan 06 '19 at 09:01
  • And is there a way to test that LLMNR is functioning as opposed to other methods like Avahi? – Oxwivi Jan 06 '19 at 09:02
  • Try pinging the RPi's hostname from the Windows machine. – Johan Myréen Jan 06 '19 at 10:55
  • Well, I set it up in the target LAN. All devices are on `192.168.13.0/24` subnet. Pinging `raspberrypi` (default Raspbian hostname) or `raspberrypi.local` yielded no results. – Oxwivi Jan 10 '19 at 07:21