Is it possible now via Luci to configured different DNS server per static lease?
At least it's possible via uci or direct file changes to /etc/config/network.
No. You should really get familiar with SSH/UCI/file changes. It's really easy once you do it a few times.
https://openwrt.org/docs/guide-quick-start/sshadministration
https://openwrt.org/docs/guide-user/base-system/uci
https://openwrt.org/docs/guide-user/base-system/dhcp_configuration#static_leases
When I try to add list dhcp_option '6,94.140.14.15,94.140.14.16' it doesn't get assigned to the host
config host
option mac '80:32:53:38:AB:E4'
option name 'SomePC'
option dns '1'
option ip '192.168.1.5'
list dhcp_option '6,94.140.14.15,94.140.14.16'
Can you try
list dhcp_option '6,94.140.14.15'
list dhcp_option '6,94.140.14.16'
Then you need to restart the dnsmasq service
/etc/init.d/dnsmasq restart
Edit:
Actually after looking at
https://openwrt.org/docs/guide-user/base-system/dhcp_configuration#providing_custom_dns_with_dhcp
It looks as though the way you set it might be correct. Did you restart dnsmasq after making the change?
Yes I restarted the dnsmasq, will try to separate line by line.
it gives this DHCP
Wireless LAN adapter Wi-Fi:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Intel(R) Wi-Fi 6E AX211 160MHz
Physical Address. . . . . . . . . : REDACTED
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
Link-local IPv6 Address . . . . . : fe80::1b:9343:9f88:61b2%26(Preferred)
IPv4 Address. . . . . . . . . . . : 192.168.1.34(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Lease Obtained. . . . . . . . . . : Friday, February 21, 2025 12:25:59 AM
Lease Expires . . . . . . . . . . : Saturday, February 22, 2025 10:31:46 AM
Default Gateway . . . . . . . . . : 192.168.1.1
DHCP Server . . . . . . . . . . . : 192.168.1.1
DHCPv6 IAID . . . . . . . . . . . : 562870398
DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-2E-20-9A-D9-8C-B8-7E-A0-C9-77
DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1
fec0:0:0:ffff::2%1
fec0:0:0:ffff::3%1
NetBIOS over Tcpip. . . . . . . . : Enabled
Is this with 2 separate lines? Can you try it with a single DNS server please?
list dhcp_option '6,94.140.14.15'
Are you able to check the logs to see if there are any errors after restarting dnsmasq / when the DHCP lease happens.
There is a specific way to set individual options.
config tag 'custom_dns'
option dhcp_option '6,94.140.14.15,94.140.14.16'
config host
option mac '80:32:53:38:AB:E4'
option name 'SomePC'
option dns '1'
option ip '192.168.1.5'
option tag 'custom_dns'
You have set a static lease of 192.168.1.5 so it looks like this is not the pc you have set a static lease for, i.e the mac address is not corresponding
it is just a sample of my other hosts
Hi,
This is working thanks!
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.