2

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

5

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
| improve this answer | |
  • 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 – Satish Jun 29 '18 at 15:43

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.