3

I have configured systemd-networkd to setup my networking, I have created vlan10 and i want to client send hostname to DHCP to register in my DDNS server so question is does networkd support DHCP_HOSTNAME= option?

[root@localhost network]# cat vlan10.network [Match] Name=vlan10 [Network] DHCP=yes 

I have multiple VLAN and i want to send two different vlan hostname to dhcp server to register them in DNS for example

vlan10 will send hostname foo.vlan10.example.com

vlan 20 will send hostname foo.vlan20.examplee.com

1 Answer 1

7

Since systemd 223 you can do this. It introduces two options for systemd-networkd

SendHostname= When true (the default), the machine's hostname will be sent to the DHCP server.

Hostname= Use this value for the hostname which is sent to the DHCP server, instead of machine's hostname.

Options must be set in [DHCP] section in your .network file. So from your example vlan10.network should look like

[Match] Name=vlan10 [Network] DHCP=yes [DHCP] SendHostname=True Hostname=foo.vlan10.example.com 
2
  • I am using 219 version on CentOS7 :( that is the problem i think... I have tired to upgrade systemd on centOS7 but it throwing bunch of dependencies Commented Jun 29, 2018 at 15:43
  • This worked for me, but I had to make sure it was in this .network file: /run/systemd/network/10-netplan-eth0.network Commented Nov 5, 2024 at 21:14

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.