# Copyright (C) 2007 OpenWrt.org
START=60
+DNS_SERVERS=""
dhcp_calc() {
local ip="$1"
append_bool "$cfg" nodaemon "-d"
append_bool "$cfg" domainneeded "-D"
append_bool "$cfg" filterwin2k "-f"
- append_bool "$cfg" nohosts "-I $nohosts"
+ append_bool "$cfg" nohosts "-h"
append_bool "$cfg" nonegcache "-N"
append_bool "$cfg" strictorder "-o"
append_bool "$cfg" logqueries "-q"
- append_bool "$cfg" noresolv "-I $noresolv"
- append_bool "$cfg" localise_queries "-I $localise_queries"
+ append_bool "$cfg" noresolv "-R"
+ append_bool "$cfg" localise_queries "-y"
append_bool "$cfg" readethers "-Z"
append_bool "$cfg" dbus "-l"
config_get ifname "$net" ifname
[ -n "$ifname" ] || return 0
- append_bool "$cfg" ingore "-I $ifname"
+ config_get dnsserver "$net" dns
+ [ -n "$dnsserver" ] && {
+ DNS_SERVERS="$DNS_SERVERS $dnsserver"
+ }
+
+ append_bool "$cfg" ignore "-I $ifname"
config_get proto "$net" proto
[ static = "$proto" ] || return 0
leasetime="${leasetime:-12h}"
start="$(dhcp_calc "${start:-100}")"
limit="$((${limit:-150} + 1))"
- eval "$(ipcalc.sh $ipaddr $netmask $start $end)"
+ eval "$(ipcalc.sh $ipaddr $netmask $start $limit)"
append args "--dhcp-range=$name,$START,$END,$NETMASK,$leasetime${options:+ $options}"
dhcp_option_add "$cfg" "$name"
/usr/sbin/dnsmasq $args && {
rm -f /tmp/resolv.conf
- cat > /tmp/resolv.conf <<EOF
-nameserver 127.0.0.1
-search lan
-EOF
+ DNS_SERVERS="$DNS_SERVERS 127.0.0.1"
+ for DNS_SERVER in $DNS_SERVERS ; do
+ echo "nameserver $DNS_SERVER" >> /tmp/resolv.conf
+ done
}
}