aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-04-08 13:18:22 +0100
committerKeir Fraser <keir.fraser@citrix.com>2009-04-08 13:18:22 +0100
commit5c49f4e2b2903718c13a6ec5777f3a4514ea1611 (patch)
tree3569bc5c34152203bf527c19de031e9d4487a2f5
parented85358827e461b00db75a0313c14f7e21e8120d (diff)
downloadxen-5c49f4e2b2903718c13a6ec5777f3a4514ea1611.tar.gz
xen-5c49f4e2b2903718c13a6ec5777f3a4514ea1611.tar.bz2
xen-5c49f4e2b2903718c13a6ec5777f3a4514ea1611.zip
network-nat: add domain info for nat-dhcpd
Signed-off-by: Wei Kong <weikong.cn@gmail.com>
-rw-r--r--tools/hotplug/Linux/network-nat6
1 files changed, 5 insertions, 1 deletions
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