Add a config list to the 'config dnsmasq' section to specify fixed DNS
addresses.

For example:

  config dnsmasq:
        [snip]
        list address '/example.com/192.168.0.1'

will result in the argument '-A /example.com/192.168.0.1' to the dnsmasq
options. This configures dnsmasq to return the specified IP for any
queries to '*.example.com' names.

Useful for overriding lookups to a range of DNS names.

Signed-off-by: Jeremy Kerr <[email protected]>

---
 package/dnsmasq/files/dnsmasq.init |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/package/dnsmasq/files/dnsmasq.init 
b/package/dnsmasq/files/dnsmasq.init
index b5ecf1d..78db87b 100644
--- a/package/dnsmasq/files/dnsmasq.init
+++ b/package/dnsmasq/files/dnsmasq.init
@@ -40,6 +40,10 @@ append_server() {
        append args "-S $1"
 }
 
+append_address() {
+       append args "-A $1"
+}
+
 append_interface() {
        append args "-i $1"
 }
@@ -72,6 +76,7 @@ dnsmasq() {
        append_parm "$cfg" "domain" "-s"
        append_parm "$cfg" "local" "-S"
        config_list_foreach "$cfg" "server" append_server
+       config_list_foreach "$cfg" "address" append_address
        config_list_foreach "$cfg" "interface" append_interface
        append_parm "$cfg" "leasefile" "-l"
        append_parm "$cfg" "resolvfile" "-r"
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to