Quick installation of nova-dns with:
- use PowerDNS as DNS backend (with nova_dns.dnsmanager.powerdns.Manager dns_manager)
- use MySQL database as storage for PowerDNS
- use nova_dns.listener.simple.Listener as AMQP listener
yum install nova-dns
Note
installation from epel repository
yum install pdns pdns-backend-mysql
export DBNAME="pdns"
export DBUSER="pdns"
export DBPASS="pdns"
export DBROOTPASS="nova"
echo "create database $DBNAME; grant all on $DBNAME.* " \
" to $DBUSER@localhost identified by '$DBPASS'" \
| mysql -u root -p"$DBROOTPASS"
Choose local ip addresses to bind, comma separated:
Warning
if you run nova-dns on same server with nova-compute, there are already started one or several dnsmasq on 53 port on local interfaces
export LOCALIP="127.0.0.1"
echo "launch=gmysql
gmysql-host=127.0.0.1
gmysql-dbname=$DBNAME
gmysql-user=$DBUSER
gmysql-password=$DBPASS
local-address=$LOCALIP" > /etc/pdns/pdns.conf
Start the server and add it to autostart:
service pdns start
chkconfig pdns on
Warning
quick setup of slave PowerDNS
locate nova.conf (usually in /etc/nova/nova.conf):
export NOVA=/etc/nova/nova.conf
add credentials for SQL connection:
echo "--dns_sql_connection=mysql://$DBUSER:$DBPASS@localhost/$DBNAME" >> $NOVA
setup defaults for SOA:
echo "--dns_default_ttl=7200
--dns_soa_primary=ns1@my_host.com
--dns_soa_email=hostmaster@my_host.com" >> $NOVA
setup zone for fixed_ip records:
echo "--dns_zone=cloud.my_host.com" >> $NOVA
setup ns servers:
LOCALDNS=`perl -e '$ns=1; print join(",", map {sprintf "ns%d:%s", $ns++, $_} split /\s*,\s*/,$ARGV[0])' "$LOCALIP"
echo "--dns_ns=$LOCALDNS" >> $NOVA
add service in keystone
keystone-manage service add nova_dns nova_dns "DNS for OpenStack"
keystone-manage endpointTemplates add RegionOne nova_dns http://$LOCALIP:15353 http://$LOCALIP:15353 http://$LOCALIP:15353 1 1
start service:
service nova-dns start