Skip to content

Commit 8cb51dc

Browse files
author
Sheng Yang
committed
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.
1 parent a930b75 commit 8cb51dc

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

‎server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2030,7 +2030,7 @@ public boolean finalizeVirtualMachineProfile(VirtualMachineProfile profile, Depl
20302030

20312031
boolean useExtDns = !dnsProvided;
20322032
/* For backward compatibility */
2033-
useExtDns = UseExternalDnsServers.valueIn(dc.getId());
2033+
useExtDns = useExtDns || UseExternalDnsServers.valueIn(dc.getId());
20342034

20352035
if (useExtDns) {
20362036
buf.append(" useextdns=true");

‎systemvm/patches/debian/config/etc/init.d/cloud-early-config‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,12 @@ setup_dnsmasq() {
715715
then
716716
[ $ETH0_IP ] && NS="$INTERNAL_DNS,$NS"
717717
[ $ETH0_IP6 ] && NS6="[::],$NS6"
718+
# enable dns
719+
sed -i -e "/^[#]*port=.*$/d" /etc/dnsmasq.conf
720+
else
721+
# disable dns
722+
sed -i -e "/^[#]*port=.*$/d" /etc/dnsmasq.conf
723+
echo "port=0" >> /etc/dnsmasq.conf
718724
fi
719725
NS=${NS%?}
720726
NS6=${NS6%?}

0 commit comments

Comments
 (0)