LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-07-2022, 05:11 AM   #1
rdahal
LQ Newbie
 
Registered: Jan 2016
Posts: 10

Rep: Reputation: Disabled
DNS upstream IP not changing on dnsmasq with Netplan


I am running dnsmasq (Version: 2.80-1.1ubuntu1.5) on Ubuntu-20.04.04, the network interface is being managed by Netplan rendered inuse is networkd.

The DNSMasq forwards requests to the upstream nameserver IP as defined for the resolution.No issues till now. But when I change nameserver IP and check the status of dnsmasq, it still shows request being forwarded to old nameserver IP. I even tested after restarting the DNSmasq service and machine, but the issue still persists.

Any help on this is highly appreciated.

Thanks in advance.



root@myserver:~# cat /etc/netplan/00-installer-config.yaml | grep -A3 "nameservers"

nameservers:
addresses:
- 10.0.3.2
- 8.8.4.4

root@myserver:~# systemctl status dnsmasq | grep -i nameserver
Sep 06 10:43:40 myserver dnsmasq[1318]: using nameserver 10.0.3.2#53
root@myserver:~# vi /etc/netplan/00-installer-config.yaml
root@myserver:~# netplan apply
root@myserver:~# cat /etc/netplan/00-installer-config.yaml | grep -A3 "nameservers"

nameservers:
addresses:
- 8.8.8.8
- 8.8.4.4

root@myserver:~# systemctl status dnsmasq | grep -i nameserver
Sep 06 10:43:40 myserver dnsmasq[1318]: using nameserver 10.0.3.2#53 <-------- OLD UP STREAM IP IN USE


+++Netplan config+++
root@myserver:~# cat /etc/netplan/00-installer-config.yaml
network:
version: 2
renderer: networkd
ethernets:
eth0:
addresses:
- 10.45.3.25/24
gateway4: 10.45.3.1
nameservers:
addresses:
- 8.8.8.8
- 8.8.4.4
root@myserver:~#


++++DNSMasq config+++
root@myserver:~# cat /etc/dnsmasq.conf | grep -v '#' |uniq
resolv-file=/etc/resolv.dnsmasq
listen-address=127.0.0.1,172.17.0.1
cache-size=1000
root@myserver:~#
 
Old 09-07-2022, 09:38 AM   #2
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 5,767

Rep: Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765
There is no "Magic Link" between dnsmasq and, well, really anything else. Dnsmasq picks up the contents of resolv.conf at startup, or when triggered to update. (See man pages and how-to documents.)
When you change the addresses, do something like restart dnsmasq to pick up the changes.
 
Old 09-13-2022, 08:50 PM   #3
elgrandeperro
Member
 
Registered: Apr 2021
Posts: 415
Blog Entries: 2

Rep: Reputation: Disabled
what is in /etc/resolv.dnsmasq? That is supplanting /etc/resolv.conf and the input of netplan.
 
  


Reply

Tags
dnsmasq, nameservers, netplan, network confguration, ubuntu



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Have a Plan for Netplan LXer Syndicated Linux News 0 10-17-2018 12:32 AM
LXer: How to Use the Netplan Network Configuration Tool on Linux LXer Syndicated Linux News 0 09-09-2018 04:51 AM
Ubuntu 17.04, netplan, bring up interface without ip da1 Ubuntu 3 01-24-2018 10:04 AM
Managed DNS server lists and dnsmasq DNS cache nitrousoxide82 Linux - Networking 1 02-21-2014 10:34 PM
[SOLVED] dnsmasq: how to prevent upstream queries for hosts in /etc/hosts? catkin Linux - Networking 2 02-18-2013 10:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration