Is there any reason, why configuration like this in the /host/config/dhcp file
config host
option name 'mylaptop' # Hostname (optional, for reference)
option mac '11:22:33:44:55:66' # MAC address of the client
option ip '192.168.1.101' # Static IP to assign to the client
option dns '192.168.1.10' # Custom DNS server for this client*
could doesn't work, means custom DNS server is not assigned to the 'mylaptop' client?
Client still uses the default DHCP's DNS server..
Instead of 'option dns' I tried to use also
list dhcp_option '6,192.168.1.10'
In this way I would like to assign local custom DNS server (later also IPv6) to few DHCP clients, while keeping default external one for all others.
... added almost the same configuration to my /etc/config/dhcp, except 'option dhcp_option...', but neither works with 'list dhcp_option...'
config my_DNS 'tag1'
option dhcp_option '6,192.168.1.10' #neither works with list dhcp_option
config host
option name 'myLaptop'
option leasetime 'infinite'
option ip '192.168.1.8'
list mac 'F0:DD:DD:DD:DD:DD'
list tag 'tag1'
Sure, here is my /etc/config/dhcp, hidden MACs, changed used subnet), for the test purpose I've removed all other leases.
root@router:~# cat /etc/config/dhcp
config dnsmasq
option domainneeded '1'
option localise_queries '1'
option rebind_protection '1'
option rebind_localhost '1'
option local '/lan/'
option domain 'lan'
option expandhosts '1'
option cachesize '1000'
option authoritative '1'
option readethers '1'
option leasefile '/tmp/dhcp.leases'
option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
option localservice '1'
option ednspacket_max '1232'
config dhcp 'lan'
option interface 'lan'
option start '100'
option limit '200'
option leasetime '12h'
option dhcpv4 'server'
option dhcpv6 'server'
option ra 'server'
list ra_flags 'managed-config'
list ra_flags 'other-config'
config dhcp 'wan'
option interface 'wan'
option ignore '1'
config odhcpd 'odhcpd'
option maindhcp '0'
option leasefile '/tmp/hosts/odhcpd'
option leasetrigger '/usr/sbin/odhcpd-update'
option loglevel '4'
config myDNS 'tag1'
option dhcp_option '6,192.168.1.10'
config host
option name 'myDNSsrv'
option leasetime 'infinite'
option ip '192.168.1.10'
option dns '1'
list mac 'E0:DD:DD:DD:DD:DD'
config host
option name 'myLaptop'
option leasetime 'infinite'
option ip '192.168.1.8'
list mac 'F0:DD:DD:DD:DD:DD'
list tag 'tag1'
config host
option name 'AnotherDevice'
option leasetime 'infinite'
option ip '192.168.1.12'
list mac 'D0:DD:DD:DD:DD:DD'
list tag 'tag1'
root@router:~#
Client always receive router's IP as DNS, not my own DNS
Link 3 (wl...)
Current Scopes: DNS
Protocols: +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Current DNS Server: 192.168.1.1
DNS Servers: 192.168.1.1 fdaf:DDDD:DDDD::1
DNS Domain: lan
If you want to name the tag section my_DNS, the config should look like this:
config tag 'my_DNS'
option dhcp_option '6,192.168.1.10'
config host
option name 'myLaptop'
option leasetime 'infinite'
option ip '192.168.2.8'
list mac 'F0:DD:DD:DD:DD:DD'
option tag 'my_DNS'