4-setting-dns-server.sh 890 Bytes
Newer Older
aticig's avatar
aticig committed
1
2
#!/bin/bash

Ubuntu's avatar
Ubuntu committed
3
export PDNS_NS_NAME=powerdns_ns
aticig's avatar
aticig committed
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
VNF_ID=`osm vnf-list --ns $PDNS_NS_NAME | grep powerdns | awk '{print $2}'`

echo "========================================================================"
echo "VNF ID $VNF_ID"
echo "========================================================================"

export DNS_IP=`osm vnf-show $VNF_ID --literal | yq -e '.kdur[0].services[] | select(.name | contains("udp")) | .external_ip' | tr -d ' '-`

echo "========================================================================"
echo "DNS IP $DNS_IP"
echo "========================================================================"

echo "========================================================================"
echo "Setting DNS Server in your machine"
echo "========================================================================"
Ubuntu's avatar
Ubuntu committed
19
sudo  sed -i "1s/^/nameserver $DNS_IP\n/"  /etc/resolv.conf