From 38befcd2280a9a8b29eacd3367654c7b7dfbd49e Mon Sep 17 00:00:00 2001 From: anthony Date: Tue, 3 Jul 2012 19:09:43 -0700 Subject: [PATCH] CS-15427 : always provide gateway as DNS server due to no traffic is allowed by ACL, the external DNS doesn't work by default --- .../debian/config/etc/init.d/cloud-early-config | 6 ++++++ .../debian/config/opt/cloud/bin/vpc_guestnw.sh | 11 +++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/patches/systemvm/debian/config/etc/init.d/cloud-early-config b/patches/systemvm/debian/config/etc/init.d/cloud-early-config index 3a8f11d8de3..2e6d3c3bca7 100755 --- a/patches/systemvm/debian/config/etc/init.d/cloud-early-config +++ b/patches/systemvm/debian/config/etc/init.d/cloud-early-config @@ -624,6 +624,12 @@ EOF cp /etc/cloud-nic.rules /etc/udev/rules.d/cloud-nic.rules echo "" > /etc/dnsmasq.d/dhcphosts.txt echo "dhcp-hostsfile=/etc/dhcphosts.txt" > /etc/dnsmasq.d/cloud.conf + + [ -z $DOMAIN ] && DOMAIN="cloudnine.internal" + #DNS server will append $DOMAIN to local queries + sed -r -i s/^[#]?domain=.*$/domain=$DOMAIN/ /etc/dnsmasq.conf + #answer all local domain queries + sed -i -e "s/^[#]*local=.*$/local=\/$DOMAIN\//" /etc/dnsmasq.conf } diff --git a/patches/systemvm/debian/config/opt/cloud/bin/vpc_guestnw.sh b/patches/systemvm/debian/config/opt/cloud/bin/vpc_guestnw.sh index 54ac7c8b7ae..506d369fff9 100755 --- a/patches/systemvm/debian/config/opt/cloud/bin/vpc_guestnw.sh +++ b/patches/systemvm/debian/config/opt/cloud/bin/vpc_guestnw.sh @@ -44,16 +44,15 @@ setup_dnsmasq() { fi # setup DNS sed -i -e "/^[#]*dhcp-option=tag:interface-$dev,6.*$/d" /etc/dnsmasq.d/cloud.conf - if [ -n "$DNS" ] + if [ -n "$gw" ] then - echo "dhcp-option=tag:interface-$dev,6,$DNS" >> /etc/dnsmasq.d/cloud.conf + echo "dhcp-option=tag:interface-$dev,6,$gw" >> /etc/dnsmasq.d/cloud.conf fi # setup DOMAIN + [ -z $DOMAIN ] && DOMAIN="cloudnine.internal" + sed -i -e "/^[#]*dhcp-option=tag:interface-$dev,15.*$/d" /etc/dnsmasq.d/cloud.conf - if [ -n "$DOMAIN" ] - then - echo "dhcp-option=tag:interface-$dev,15,$DOMAIN" >> /etc/dnsmasq.d/cloud.conf - fi + echo "dhcp-option=tag:interface-$dev,15,$DOMAIN" >> /etc/dnsmasq.d/cloud.conf service dnsmasq restart sleep 1 }