dnsmasq keeps changing nameservers?

On my Ubuntu 14.04 VPS, dnsmasq keeps changing my nameservers under /run/resolv.conf when it renews leases every few hours. I had installed dnsmasq as part of my OpenVPN setup following a Linode doc.

I now regularly check and force Google DNS into the /etc/dnsmasq.conf, /run/dnsmasq, /run/resolvconf/, /run/resolvconf/interface/, /etc/resolvconf/resolv.conf.d/, /var/lib/dhcp/ files, etc. Note that

/etc/resolv.conf -> ../run/resolvconf/resolv.conf.

I have checked a lot of posting that claim to control this, but inevitably there are more recent postings debunking those claims.

dnsmasq keeps changing my Google DNS to the Linode nameservers?

7 Replies

Please have a look at the cronjobs, maybe there is some cron set to revert them back to old nameservers

My latest changes seems to have solved the specific problem. Now I have to see if this wrecked anything else.

Hi. Yes, that was looked at early after I saw this happening. I see nothing under /var/spool/cron/crontabs/root that would do this. I see no other crontab files under /var/spool/cron/ .

I also tried:

:/etc# grep -i dns cron*

:/etc# grep -i dns cron/

:/etc# grep -i dns cron//*

but nothing came up.

Thanks.

Lester

Take a look in the /etc/cron.* directories?

Alternatively, manually define nameservers in /etc/network/interfaces, 'auto eth0; iface eth0 inet dynamic' add 'dns-nameservers 8.8.8.8, 8.8.4.4'.

(Alternatively, remove the symlink /etc/resolv.conf, and make a new file)

Hi. yes, I believe I did that (just checked again).

I just now made a couple of changes:

/etc/dnsmasq.conf (set no-poll)

/etc/default/dnsmasq (set IGNORE_RESOLVCONF=yes and ENABLED=0)

I don't think changing the symlink will help as OpenVPN looks at /run/dnsmasq/resolv.conf , even if /run/resolvconf/resolv.conf is set as I wish.

I'm trying to do gradual minimal changes to not break OpenVPN.

I'll check /var/log/syslog again tomorrow.

Thanks.

Lester

Nope. I still am getting many lines in /var/log/apache2/othervhostsaccess.log like:

::1 - - [23/Jun/2015:18:42:53 -0700] "OPTIONS * HTTP/1.0" 403 0 "-" "Apache/2.4.7 (Ubuntu) OpenSSL/1.0.1f (internal dummy connection)"

The 403 errors seem to have been due to

coming after

in my ssl.conf file. Once this was fixed, I do not have the 403 problems.

The dnsmasq behavior has not been fixed. I have to poll several files regularly to "correct" my nameservers.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct