You are not logged in.

#1 2017-08-19 16:37:16

bonob
Member
Registered: 2014-02-02
Posts: 23

[Solved] Openresolv - resolvconf, merge localhost with dhcp data

I don't understand how resolvconf works, and it seems I'm misinterpreting what I read in the resolvconf.conf(5) manpage.

What I would like is for resolvconf -u to generate a resolv.conf file that contains both the values from the dhcp server (my router) and localhost.
I understand that this should be the result of 3 possible configurations:
- Add a line name_servers=127.0.0.1 in resolvconf.conf
- Add a line prepend_nameservers=127.0.0.1 in resolvconf.conf
- Create a file named /etc/resolv.conf.head with a line nameserver=127.0.0.1

However, trying any of these configurations, the generated resolv.conf only contains nameserver=127.0.0.1
On the other hand, removing all 3 of these configurations, the generated resolv.conf is as follows:

# Generated by resolvconf
domain lan
nameserver 192.168.0.1

I believe these values come from the dhcp on the router.

The generated resolv.conf I'm after would be as follows:

# Generated by resolvconf
domain lan
nameserver 127.0.0.1
nameserver 192.168.0.1

Besides tentative lines for name_servers or prepend_nameservers, the content of resolvconf.conf is simply:

# Configuration for resolvconf(8)
# See resolvconf.conf(5) for details

resolv_conf=/etc/resolv.conf
# If you run a local name server, you should uncomment the below line and
# configure your subscribers configuration files below.
#name_servers=127.0.0.1

I'm assuming the bit that I'm missing is the "subscribers configuration files", but I don't understand what that means.
I use netctl for network management, with simple dhcp; I also have a local dnsmasq service.
The purpose of the configuration is that local network is resolved by the router, and the rest by the local dnsmasq.

Last edited by bonob (2017-08-20 13:16:33)

Offline

#2 2017-08-19 20:52:58

Tarqi
Member
From: Ixtlan
Registered: 2012-11-27
Posts: 179
Website

Re: [Solved] Openresolv - resolvconf, merge localhost with dhcp data

bonob wrote:

- Create a file named /etc/resolv.conf.head with a line nameserver=127.0.0.1

Remove that equal (=) and try again.

bonob wrote:

The purpose of the configuration is that local network is resolved by the router, and the rest by the local dnsmasq.

Note: This needs to be configured in dnsmasq, alternate DNS will only be queried if the used one timeouts.

Last edited by Tarqi (2017-08-20 00:15:26)


Knowing others is wisdom, knowing yourself is enlightenment. ~Lao Tse

Offline

#3 2017-08-20 13:16:15

bonob
Member
Registered: 2014-02-02
Posts: 23

Re: [Solved] Openresolv - resolvconf, merge localhost with dhcp data

Yes, with namerserver 127.0.0.1 in resolv.conf.head, the resulting resolv.conf only contains this line.
But I found the solution, it's to add

resolv_conf_local_only=NO

in resolvconf.conf, as suggested here: https://bbs.archlinux.org/viewtopic.php?id=161260

What I want is that the alternate name server (192.168.0.1) is used only if the local server does not answer. With this resolv.conf it works, after a timeout which is a bit long. I didn't find the way to reach the same effect with dnsmasq.

Offline

#4 2017-08-20 13:32:34

Tarqi
Member
From: Ixtlan
Registered: 2012-11-27
Posts: 179
Website

Re: [Solved] Openresolv - resolvconf, merge localhost with dhcp data

bonob wrote:

What I want is that the alternate name server (192.168.0.1) is used only if the local server does not answer. With this resolv.conf it works, after a timeout which is a bit long. I didn't find the way to reach the same effect with dnsmasq.

This is not what you told us before. Moreover the last sentence doesn't make sense. Read this please. However, if it's solved, it is solved.


Knowing others is wisdom, knowing yourself is enlightenment. ~Lao Tse

Offline

#5 2017-08-20 13:39:46

bonob
Member
Registered: 2014-02-02
Posts: 23

Re: [Solved] Openresolv - resolvconf, merge localhost with dhcp data

Indeed I omitted the part about falling back to 192.168.0.1 in case the name server that dnsmasq is talking to does not reply.
What I said first was correct though, dnsmasq will ask 192.168.0.1 for local domain, and another service for the rest. What I've not been able to do with dnsmasq it to let it fall back to 192.168.0.1 for non local domain names.

I understand my explanations are not clear, the topic is quite obscure for me. My apologies for the confusion.

Offline

#6 2017-08-21 20:06:06

Tarqi
Member
From: Ixtlan
Registered: 2012-11-27
Posts: 179
Website

Re: [Solved] Openresolv - resolvconf, merge localhost with dhcp data

bonob wrote:

My apologies for the confusion.

Thanks and sorry for the rudness, wasn't intended.


Knowing others is wisdom, knowing yourself is enlightenment. ~Lao Tse

Offline

Board footer

Powered by FluxBB