mirror of https://github.com/apache/cloudstack.git
CS-15427 : always provide gateway as DNS server due to no traffic is allowed by ACL, the external DNS doesn't work by default
This commit is contained in:
parent
1ac1bcb2f6
commit
38befcd228
|
|
@ -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
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue