aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2012-07-05 17:54:14 +0000
committerJo-Philipp Wich <jow@openwrt.org>2012-07-05 17:54:14 +0000
commitcfe8557f62a5b89fc7e517275df72ca261b23adc (patch)
tree7a2587357a2681bb7870b3bff04112b2f6790c58 /package
parent2660f6d8df9f7285aa404950459a8d4562f6727d (diff)
downloadupstream-cfe8557f62a5b89fc7e517275df72ca261b23adc.tar.gz
upstream-cfe8557f62a5b89fc7e517275df72ca261b23adc.tar.bz2
upstream-cfe8557f62a5b89fc7e517275df72ca261b23adc.zip
package/dnsmasq: allow /etc/config/dhcp to specify --address arguments
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. [jow: "append args" -> "xappend", "-A" -> "--address"] Signed-off-by: Jeremy Kerr <jk@ozlabs.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@32624 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package')
-rw-r--r--package/dnsmasq/files/dnsmasq.init5
1 files changed, 5 insertions, 0 deletions
diff --git a/package/dnsmasq/files/dnsmasq.init b/package/dnsmasq/files/dnsmasq.init
index 15228da99e..85c22c3745 100644
--- a/package/dnsmasq/files/dnsmasq.init
+++ b/package/dnsmasq/files/dnsmasq.init
@@ -55,6 +55,10 @@ append_server() {
xappend "--server=$1"
}
+append_address() {
+ xappend "--address=$1"
+}
+
append_interface() {
local ifname=$(uci_get_state network "$1" ifname "$1")
xappend "--interface=$ifname"
@@ -103,6 +107,7 @@ dnsmasq() {
append_parm "$cfg" "domain" "--domain"
append_parm "$cfg" "local" "--server"
config_list_foreach "$cfg" "server" append_server
+ config_list_foreach "$cfg" "address" append_address
config_list_foreach "$cfg" "interface" append_interface
config_list_foreach "$cfg" "notinterface" append_notinterface
config_list_foreach "$cfg" "addnhosts" append_addnhosts