From: Keir Fraser Date: Wed, 8 Apr 2009 12:18:22 +0000 (+0100) Subject: network-nat: add domain info for nat-dhcpd X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~13988^2~16 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=5c49f4e2b2903718c13a6ec5777f3a4514ea1611;p=xen.git network-nat: add domain info for nat-dhcpd Signed-off-by: Wei Kong --- diff --git a/tools/hotplug/Linux/network-nat b/tools/hotplug/Linux/network-nat index d9c62c6160..aab793d93f 100644 --- a/tools/hotplug/Linux/network-nat +++ b/tools/hotplug/Linux/network-nat @@ -48,12 +48,16 @@ then fi fi +domain_name=`cat /etc/resolv.conf | grep -v "#" | grep -E 'search|domain' -i | tail -n 1 | awk '{ print $2 }'` +nameserver=`cat /etc/resolv.conf | grep -v "#" | grep "nameserver" -i -m 1 | awk '{ print $2 }'` function dhcp_start() { if ! grep -q "subnet 10.0.0.0" "$dhcpd_conf_file" then - echo >>"$dhcpd_conf_file" "subnet 10.0.0.0 netmask 255.255.0.0 {}" + echo >>"$dhcpd_conf_file" "subnet 10.0.0.0 netmask 255.255.0.0 {\ + option domain-name \"$domain_name\";\ + option domain-name-servers $nameserver; }" fi "$dhcpd_init_file" restart