CLOUDSTACK-5533: Disable VR's DNS functionality if user choose to use external dns

Also fix the regression that external dns won't be used if "dns" service in the
network offering is unset.
This commit is contained in:
Sheng Yang 2013-12-17 16:04:21 -08:00
parent a930b7576a
commit 8cb51dcc88
2 changed files with 7 additions and 1 deletions

View File

@ -2030,7 +2030,7 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V
boolean useExtDns = !dnsProvided;
/* For backward compatibility */
useExtDns = UseExternalDnsServers.valueIn(dc.getId());
useExtDns = useExtDns || UseExternalDnsServers.valueIn(dc.getId());
if (useExtDns) {
buf.append(" useextdns=true");

View File

@ -715,6 +715,12 @@ setup_dnsmasq() {
then
[ $ETH0_IP ] && NS="$INTERNAL_DNS,$NS"
[ $ETH0_IP6 ] && NS6="[::],$NS6"
# enable dns
sed -i -e "/^[#]*port=.*$/d" /etc/dnsmasq.conf
else
# disable dns
sed -i -e "/^[#]*port=.*$/d" /etc/dnsmasq.conf
echo "port=0" >> /etc/dnsmasq.conf
fi
NS=${NS%?}
NS6=${NS6%?}