Outils pour utilisateurs

Outils du site


Panneau latéral

hostname

nmb(d) est fourni par samba ?

Is it possible to connect to a device using its hostname?

On some networks – yes. But on your everyday TCP/IP network, the hostname must be translatable to an IP address, otherwise clients will not know what to connect to.

There are several existing protocols for local name lookup, though:

Windows uses NetBIOS name services for resolving hostnames of other computers in the same LAN, using UDP broadcasts. Your server will need to run the nmbd component of Samba to be discoverable using NetBIOS.

(Recent Windows versions also support LLMNR, which is similar to mDNS but has fewer features and requires IPv6. On Linux, systemd-resolved will have a LLMNR client. No idea about other operating systems. Probably not worth considering.)

OS X uses mDNS (“multicast DNS”), sometimes known as Bonjour, for the same purposes. (Note that mDNS generally does not resolve bare hostnames like NetBIOS would; instead, it is limited to the .local domain.) For mDNS, your server will need avahi-daemon.

(Also, Windows can resolve mDNS names if Bonjour is installed (typically as part of iTunes), and OS X should support NetBIOS if “Windows file sharing” or a similar service is enabled.)

Desktop-oriented Linux systems often come with both NetBIOS and mDNS resolvers preconfigured. (That is, they run both nmbd and avahi-daemon, plus the relevant glibc NSS modules in /etc/nsswitch.conf.)

Finally, most “home routers” maintain a local DNS domain (.lan, .home, &c.) according to hostnames they receive from DHCP requests sent by computers in the LAN. Depending on what your server uses, dhcpcd needs the “hostname” option, while dhclient uses “send host-name = gethostname()”.

hostname.txt · Dernière modification: 2018/10/13 20:32 (modification externe)