How to set system domain-name from dhcp

Is there a way to set the system domain name from the options received via DHCPv4?

Version : VyOS 1.5-rolling-202407280023

Hello,

From VyOS 1.5 documentation: DHCP Server — VyOS 1.5.x (circinus) documentation

set service dhcp-server shared-network-name <name> option domain-name <domain-name>

The domain-name parameter should be the domain name that will be appended to the client’s hostname to form a fully-qualified domain-name (FQDN) (DHCP Option 015).

1 Like

I checked that it was set on the DHCP server. :white_check_mark:

If you look at the output below though you can see that my VyOS router is getting a DHCP lease that includes a domain name and name servers.

The system name servers are being set by set system name-server 'eth0'

The domain name though is not set. I was wondering if there was an equivalent i.e. set system domain-name 'eth0' - that command is accepted but doesn’t work!

I don’t think I need this functionally, I was just curious.

vyos@r1:~$ show dhcp client lease
Interface    eth0
IP address   192.168.1.100                 [Active]
Subnet Mask  255.255.255.0
Domain Name  home.local
Router       192.168.1.1
Name Server  192.168.1.1
DHCP Server  192.168.1.1
DHCP Server  86400
VRF          default
Last Update  Tue Jul 30 23:21:27 UTC 2024
Expiry       Wed Jul 31 23:21:27 UTC 2024

vyos@r1:~$ show host domain
vyos@r1:~$ domainname
(none)
vyos@r1:~$ cat /etc/resolv.conf
### Autogenerated by VyOS ###
### Do not edit, your changes will get overwritten ###


# dhcp-eth0
nameserver 192.168.1.1


# dhcp-eth0
search home.local
vyos@r1:~$ nslookup google.com
Server:		192.168.1.1
Address:	192.168.1.1#53

Non-authoritative answer:
Name:	google.com
Address: 142.250.70.142
Name:	google.com
Address: 2404:6800:4015:800::200e

Ah ok, I do not know about this particular use case.

1 Like