# Help needed with dhcpcd/openresolv/dnsmasq

## VinzC

Hi.

It looks like openresolv has changed recently and I can't seem to make it with the new version. E.g. directory /etc/resolvconf/ isn't used anymore in favor of new configuration files and methods. I'm using dnsmasq as a local dns cache and as a forwarder for my virtual machines.

Currently my network interfaces are as follows:lo: local loopback

eth0, wlan0: bonded as bond0, null config

bond0: bonding interface, active interface

ppp0: PPTP VPN interface, set manually with command pon

tun0: OpenVPN tap interface, established manually running /etc/init.d/openvpn service

vnet0-vnet3: virtual tap interfaces for virtual machines, bridged as br0My problems areI can't seem to configure openresolv properly so as to automatically add the DNS servers provided by my VPN connection to the list of resolvers

I've setup dnsmasq to use local resolver /etc/dnsmasq-resolv.conf but openresolv doesn't seem to update it each time DNS servers are gotten (either from dhcpcd, pon or other VPN connections)

reverse resolution of IP addresses (e.g. dig -x ip.ad.dr.ess) doesn't work and returns empty responses except when I remove 127.0.0.1 from /etc/resolv.conf manually.

```
resolv_conf=/etc/resolv.conf

dnsmasq_resolv=/etc/dnsmasq-resolv.conf

name_servers=127.0.0.1
```

```
domain-needed

bogus-priv

filterwin2k

resolv-file=/etc/dnsmasq-resolv.conf

strict-order

server=/45.168.192.in-addr.arpa/192.168.45.1

server=/11.10.in-addr.arpa/10.11.4.15

interface=br0

interface=br1

domain=install.local

dhcp-range=install,192.168.124.100,192.168.124.199,12h

dhcp-range=test,192.168.125.100,192.168.125.199,12h

dhcp-range=192.168.1.100,192.168.1.199,12h

dhcp-option=42,0.0.0.0

dhcp-leasefile=/var/lib/dnsmasq/dnsmasq.leases
```

I'm a bit lost. Can someone lend a helping hand?

Thanks a lot in advance.

----------

## UberLord

 *VinzC wrote:*   

> 
> 
> ```
> resolv_conf=/etc/resolv.conf
> 
> ...

 

You need to set dnsmasq_conf as well.

Could you suggest a man page update so others don't get bitten by this?

----------

## VinzC

 *UberLord wrote:*   

> You need to set dnsmasq_conf as well.
> 
> Could you suggest a man page update so others don't get bitten by this?

 

Thank you, Roy, I was in fact waiting for you.  :Smile: 

What do you mean «setting dnsmasq_conf as well»? As per the man page, I shall set that variable to the same value as dnsmasq conf-file parameter. But I have defined no such parameter for dnsmasq... Does it have to point to an empty file from dnsmasq.conf?

----------

## UberLord

Yes  :Smile: 

```

resolv_conf=/etc/resolv.conf

name_servers=127.0.0.1

dnsmasq_conf=/etc/dnsmasq-resolvconf.conf

dnsmasq_resolv=/etc/dnsmasq-resolv.conf

```

```

domain-needed

interface=lo

resolv-file=/etc/dnsmasq-resolv.conf

conf-file=/etc/dnsmasq-resolvconf.conf

```

And you'll find that dnsmasq-resolvconf.conf won't be emtpy for long  :Wink: 

----------

## VinzC

Thanks. Can I make it so that (forgot to mention it in the first place) /etc.resolv.conf only contains 127.0.0.1 and not be updated? Only /etc/dnsmasq-resolv.conf should be updated with DNS servers, in fact.

----------

## UberLord

No  :Smile: 

I've started to put the DNS servers into resolv.conf after your 127.0.0.1 server just on the off chance the local resolver dies.

This has occured on a few occasions when I've been used experimental code on the local resolver and it's blown up on a remote machine.

Can you give me a good technical reason why they should not be there?

----------

## VinzC

 *UberLord wrote:*   

> No 
> 
> I've started to put the DNS servers into resolv.conf after your 127.0.0.1 server just on the off chance the local resolver dies.
> 
> This has occured on a few occasions when I've been used experimental code on the local resolver and it's blown up on a remote machine.
> ...

 

Got none in particular. I wonder if that was the reason why reverse name resolution fails when using dnsmasq on my system...

EDIT: Okay, I've made the change, restarted all my network interfaces plus dnsmasq. Reverse resolution still fails:

```
$ dig -x <ip of my laptop>

(nothing)
```

----------

## UberLord

 *VinzC wrote:*   

> Got none in particular. I wonder if that was the reason why reverse name resolution fails when using dnsmasq on my system...

 

No it's not. I use dnsmasq as a local resolver also

```
roy@uberpc ~ $ host ftp

ftp.marples.name is an alias for uberserver.marples.name.

uberserver.marples.name has address 10.73.1.1

uberserver.marples.name has IPv6 address 2a01:348:31:2:209:5bff:fe84:887d

roy@uberpc ~ $ host 2a01:348:31:2:209:5bff:fe84:887d

d.7.8.8.4.8.e.f.f.f.b.5.9.0.2.0.2.0.0.0.1.3.0.0.8.4.3.0.1.0.a.2.ip6.arpa domain name pointer uberserver.marples.name.

roy@uberpc ~ $ host 10.73.1.1

1.1.73.10.in-addr.arpa domain name pointer uberserver.marples.name.

roy@uberpc ~ $ cat /etc/resolv.conf

# Generated by resolvconf

search marples.name

nameserver 127.0.0.1

nameserver 10.73.1.1

roy@uberpc ~ $
```

----------

## VinzC

```
$ host solo

solo.olympe.local has address 192.168.45.176

$ host 192.168.45.176

Host 176.45.168.192.in-addr.arpa. not found: 3(NXDOMAIN)
```

Still got a problem, Huston...

----------

## UberLord

You sure that it's reverse-able on other hosts and not a DNS server issue?

----------

## VinzC

Well, like I said, removing 127.0.0.1 from /etc/resolv.conf (thus leaving only my home DNS machine's IP) makes the thing work. But my home DNS server is also a dnsmasq machine!  :Rolling Eyes: 

EDIT: it's just as if dnsmasq didn't forward reverse DNS requests...

```
$ host 192.168.45.176 192.168.45.1

Using domain server:

Address: 192.168.45.1#53

Aliases: 

176.45.168.192.in-addr.arpa domain name pointer solo.olympe.local.
```

So it's reverse-able, right?

----------

## UberLord

I just noticed that you're also leasing IP's on the same box in the same subnet. Could you try a more minimal configuration, like say the exact same one I use?

If that works then I suggest taking your problem to dnsmasq upstream.

----------

## VinzC

```
domain-needed

resolv-file=/etc/dnsmasq-resolv.conf

interface=lo

conf-file=/etc/dnsmasq-resolvconf.conf
```

```
$ host 192.168.45.176

Host 176.45.168.192.in-addr.arpa. not found: 3(NXDOMAIN)
```

EDIT: I'm using dnsmasq-2.45. Could it be a reason?

EDIT: Upgraded dnsmasq to version 2.47 and now the default configuration worked! Yay! Got reverse DNS resolution forwarding work!... Now trying restoring the customizations I made...

EDIT: Customizations restored, it still works:

```
$ host 192.168.45.176

176.45.168.192.in-addr.arpa domain name pointer solo.olympe.local.
```

BTW thanks a big, whole lot for taking your time to help, Roy.

----------

## VinzC

Heck! That damn thing didn't even survive a reboot! I'm still getting the infamous NXDOMAIN response when I attempt a reverse resolution against my own IP address...  :Evil or Very Mad: 

EDIT: That's also why I've been continuously seeing apache error message "Could not reliably determine the server's fully qualified domain name, using <local ip> for Server Name".

----------

## VinzC

After checking each option and rebooting each time, the problem appears after enabling dnsmasq option "bogus-priv", which is supposed not to return IP addresses out of the private routed domains, if I understood correctly. It looks like that option is buggy then.

Problem solved. Definitely, I hope...

----------

## VinzC

 *UberLord wrote:*   

> Could you suggest a man page update so others don't get bitten by this?

 

Done.

----------

