1

I set up my Banana Pi using the simple hostname bananapi which is also shown at the command line (root@bananapi:/#) and using the hostname command in my ARMBIAN shell, furthermore I customized the /etc/hosts file to fit for the same host name, still my router (Hitronhub CVE-30360) spits out something awfully strange when looking it up, it says PC-B414.

What am I missing here? Are there other files which have to be adjusted?

Thanks in advance.

tai
  • 177
  • 1
  • 1
  • 9
  • That information is only on your Banana Pi. Why should the router know what it is? You can edit this information on your router. Or you need to put it into the DNS your router uses. – mvw Feb 05 '18 at 13:36
  • @mvw Well I really doubt that I'm supposed to manually change my BananaPi's hostname on my router. Besides I never changed anything there and I reinstalled the Pi and afterwards the hostname had changed there isn't even an actual possibility to change that anywhere and why should it. My other devices are shown correctly by their given names set on the devices. – tai Feb 05 '18 at 13:49

1 Answers1

0

Dynamic IP-address allocation (central management)

If your Banana-Pi gets its IP-address from a DHCP service (e.g. on your router) then it has the opportunity to inform the DHCP server of its hostname. The DHCP service often has the facility to inform the DNS service (e.g. also on the router) of this. Otherwise your Banana-Pi may be assigned some default hostname.

Static IP-address allocation

If your Banana-Pi has a static IP-address locally configured, it won't ask the DNS server (via DHCP) to add its name to its data.

Fixed IP using DHCP reservation

If you want your Banana-Pi to have a fixed IP-address, you can configure a DHCP reservation on the router and reconfigure the Banana-pi to use DHCP. how you configure a DHCP reservation depends on the router make and model. Administratively, this is the simplest solution.

The router will then always allocate the same IP-address to the Banana-Pi and will update the DNS service with the Banana-Pi's current hostname.


References

3.3. Client Desires Server to Do DNS Updates

A client can choose to delegate the responsibility for updating the FQDN-to-IP-address mapping for the FQDN and address(es) used by the client to the server. In order to inform the server of this choice, the client SHOULD include the Client FQDN option in its DHCPREQUEST message and MAY include the Client FQDN option in its DHCPDISCOVER. The "S" bit in the Flags field in the option MUST be 1, and the "O" and "N" bits MUST be 0.

the Armbian Debian jessie dhclient does not handle a served hostname reliable

option host-name string;

This option specifies the name of the client. The name may or may not be qualified with the local domain name (it is preferable to use the domain-name option to specify the domain name). See RFC 1035 for character set restrictions. This option is only honored by dhclient-script(8) if the hostname for the client machine is not set.

The DHCP server issues a private IP address dependent upon each client's MAC address, based on a predefined mapping by the administrator. This feature is variously called static DHCP assignment by DD-WRT, fixed-address by the dhcpd documentation, address reservation by Netgear, DHCP reservation or static DHCP by Cisco and Linksys, and IP address reservation or MAC/IP address binding by various other router manufacturers. If no match for the client's MAC address is found, the server may or may not optionally fall back to either Dynamic or Automatic allocation.

RedGrittyBrick
  • 81,981
  • 20
  • 135
  • 205
  • okay, there we go: am I right in assuming that it's impossible to use both an own set host name **and** a static IP? I just edited `/etc/network/interfaces` and set `iface eth0 inet static` back to `iface eth0 inet dhcp` and now my router recognizes the Pi back as "bananapi" but not with my desired static LAN IP. – tai Feb 05 '18 at 15:00
  • @taiBsu: Instead of static-IP, you can use a "reservation" on the DHCP service. See updated answer. – RedGrittyBrick Feb 05 '18 at 15:07