0

I want to use a local hostname to access the same local server via multiple VLAN's easily.

It works very well when I set netplan to DCHP, and follow these steps: https://linuxconfig.org/how-to-change-hostname-on-ubuntu-18-04-bionic-beaver-linux

The trouble starts when I set netplan to use a static IP-address. Then suddenly, the local hostname does not work anymore.

My netplan configuration for static IP is as follows (I did not configure vlan's just yet):

network:
    ethernets:
        eno1:
            addresses: []
            dhcp4: no
        eno2:
            addresses: []
            dhcp4: no
            optional: true
        eno3:
            addresses: []
            dhcp4: no
            optional: true
        eno4:
            addresses: []
            dhcp4: no
            optional: true
    bonds:
        bond0:
            interfaces: [eno1, eno2, eno3, eno4]
            addresses: [192.168.55.10/24]
            gateway4: 192.168.55.1
            nameservers:
                search: [local]
                addresses: [192.168.55.1, 1.1.1.1]
            dhcp4: no
            parameters:
                mode: 802.3ad
    version: 2

I'm quite sure it is not the bonding, because I have also tried this configuration:

  network:
    version: 2
    ethernets:
      eno1:
        addresses: [192.168.55.10/24]
        gateway4: 192.168.55.1
        nameservers:
          search: [local]
          addresses: [192.168.55.1,1.1.1.1]
0

You should check what the DNS configuration is when using DHCP (systemd-resolve --status). It is likely that the DNS you're configuring for the static case does not exactly match what you're getting via DHCP.

Another possibility is that your DHCP server is automatically doing dyndns of your hostname, so this name only exists in the DNS records if you are using DHCP and causing it to be published.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.