sivachinnayan / consul-cluster-setup

setup consul cluster setup
MIT License
0 stars 0 forks source link

DNS forwarding from DNSMASQ to Consul DNS:8600 #13

Open sivachinnayan opened 7 years ago

sivachinnayan commented 7 years ago

https://www.consul.io/docs/guides/forwarding.html

Install dnsmasq on all nodes.

Make sure to uncomment the below line from /etc/dnsmasq.conf conf-dir=/etc/dnsmasq.d

cat /etc/dnsmasq.conf  | tail -10
# For debugging purposes, log each DNS query as it passes through
# dnsmasq.
#log-queries

# Log lots of extra information about DHCP transactions.
#log-dhcp

# Include a another lot of configuration options.
#conf-file=/etc/dnsmasq.more.conf
conf-dir=/etc/dnsmasq.d  ## uncomment this line 
$vi /etc/resolv.conf
nameserver 127.0.0.1 # add this in resolv.conf
echo "server=/consul/127.0.0.1#8600" > /etc/dnsmasq.d/10-consul
dig @127.0.0.1 -p 8600 appserver.service.consul
dig appserver.service.consul
sivachinnayan commented 7 years ago

useful commands

$netstat -plant | grep LISTEN | awk '{print $4}' | grep 0.0.0.0
cat  /var/nginx/default.conf | grep 127.0.0.1 | uniq