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 10f44276bfb..d649812051c 100755 --- a/patches/systemvm/debian/config/etc/init.d/cloud-early-config +++ b/patches/systemvm/debian/config/etc/init.d/cloud-early-config @@ -270,19 +270,6 @@ setup_dnsmasq() { echo "dhcp-option=119,$DNS_SEARCH_ORDER" >> /etc/dnsmasq.conf fi - if [ "$USE_EXTERNAL_DNS" == "true" ] - then - sed -i -e "/^[#]*dhcp-option=6.*$/d" /etc/dnsmasq.conf - if [ -n "$NS1" ] - then - if [ -n "$NS2" ] - then - echo "dhcp-option=6,$NS1,$NS2" >> /etc/dnsmasq.conf - else - echo "dhcp-option=6,$NS1" >> /etc/dnsmasq.conf - fi - fi - fi } setup_sshd(){ @@ -310,6 +297,15 @@ setup_router() { fi setup_dnsmasq + + NS=$NS1 + [ -n "$NS2" ] && NS=$NS1,$NS2 + if [ "$USE_EXTERNAL_DNS" == "true" ] + then + sed -i -e "/^[#]*dhcp-option=6.*$/d" /etc/dnsmasq.conf + echo "dhcp-option=6,$NS" >> /etc/dnsmasq.conf + fi + setup_apache2 $ETH0_IP sed -i /gateway/d /etc/hosts @@ -335,14 +331,18 @@ setup_dhcpsrvr() { NS=$NS1 [ -n "$NS2" ] && NS=$NS1,$NS2 - if [ "$DEFAULTROUTE" != "false" ] then sed -i -e "/^[#]*dhcp-option=option:router.*$/d" /etc/dnsmasq.conf echo "dhcp-option=option:router,$GW" >> /etc/dnsmasq.conf #for now set up ourself as the dns server as well sed -i -e "/^[#]*dhcp-option=6.*$/d" /etc/dnsmasq.conf - echo "dhcp-option=6,$ETH0_IP,$NS" >> /etc/dnsmasq.conf + if [ "$USE_EXTERNAL_DNS" == "true" ] + then + echo "dhcp-option=6,$NS" >> /etc/dnsmasq.conf + else + echo "dhcp-option=6,$ETH0_IP,$NS" >> /etc/dnsmasq.conf + fi else sed -i -e "/^[#]*dhcp-option=option:router.*$/d" /etc/dnsmasq.conf echo "dhcp-option=option:router" >> /etc/dnsmasq.conf diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java index d294b90616c..8975a090d68 100755 --- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java +++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java @@ -1018,7 +1018,6 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian buf.append(" dnssearchorder=").append(domain_suffix); } - if (!network.isDefault() && network.getGuestType() == GuestIpType.Direct) { buf.append(" defaultroute=false"); @@ -1036,10 +1035,10 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian if (defaultDns2 != null) { buf.append(" dns2=").append(defaultDns2); } - - String use_external_dns = _configDao.getValue("use.external.dns"); + + String use_external_dns = _configDao.getValue(Config.UseExternalDnsServers.key()); if (use_external_dns!=null && use_external_dns.equals("true")){ - buf.append(" useextdns=").append(use_external_dns); + buf.append(" useextdns=true"); } if (s_logger.isDebugEnabled()) {