Bug 134692 - modify_resolvconf does not read named.d/forwarders.conf
Summary: modify_resolvconf does not read named.d/forwarders.conf
Status: RESOLVED FIXED
: 173407 (view as bug list)
Alias: None
Product: openSUSE 10.2
Classification: openSUSE
Component: Network (show other bugs)
Version: Final
Hardware: Other Other
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Marius Tomaschewski
QA Contact: E-mail List
URL:
Whiteboard: maint:planned:sle10-sp3 maint:release...
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-21 16:17 UTC by Christian Zoz
Modified: 2009-05-04 22:09 UTC (History)
3 users (show)

See Also:
Found By: Development
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
last 1000 lines of y2log (128.08 KB, text/plain)
2006-05-12 14:18 UTC, Christian Zoz
Details
Proposed /sbin/modify_resolvconf fixes for forwarders.conf creation (2.25 KB, patch)
2009-02-13 16:31 UTC, Marius Tomaschewski
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Zoz 2005-11-21 16:17:14 UTC
modify_resolvconf does only read named.conf. But since some time we use named.d/forwarders.conf. I did not check up to now if the forwarders changes of modify_reslovconf in named.conf overwrites the settings in named.d/forwarders.conf . If not, we have probably to fix modify_resolvconf.
See also bug 55610 comment 15 and bug 55610 comment 26

On the other hand: No one complained so far. I don't know if modify_resolvconf is used frequently to change forwarders.

Lars, what do you think?
Comment 1 Lars Müller 2006-02-07 15:47:01 UTC
I don't know who moved the forwarders from the main named.conf to named.d/forwarders.conf.  This is not our default configuration.

We moved the zone definitions from named.conf to independet files in /etc/named./ to allow modify_resolvconf to modify the forwarder settings in /etc/named.conf whithout losing any changes made to zone configs.

I suggest to ignore /etc/named.d/forwarders.conf as long as you don't get a request to even check this file for forwarder statements.
Comment 2 Lukas Ocilka 2006-02-07 16:09:56 UTC
There was a request for ... 9.3 (?) to move forwarders to this file because of modify_resolvconf script which modifies the configuration when it wants. Just to prevent from data loses. But this is an old history :)
Comment 3 Christian Zoz 2006-02-07 16:44:43 UTC
So this means modify_resolvconf should stay modifying named.conf and leave everything in named.d/ alone?

Comment 4 Lukas Ocilka 2006-02-08 07:25:19 UTC
No, this means that modify_resolvconf should modify only named.d/forwarders.conf and leave named.conf alone. It should have been already adjusted to do it long time ago. I have no clue why it haven't.
Comment 5 Christian Zoz 2006-02-08 21:09:42 UTC
Thanks, Lukas. Does that mean we won't have to change named.conf no more at all?
Sorry for my repeated request, but i am really unsure, because i did not use local nameservers since some years. And in in bug 136844 comment 2 Peter Poeml wrote on 2005-12-12:
> Rewriting forwarders in local named.conf works fine

Peter, did you use MODIFY_NAMED_CONF_DYNAMICALLY recently? 
Comment 6 Lukas Ocilka 2006-02-09 07:33:55 UTC
YaST DNS Server changes /etc/named.conf. Forwarders were moved to the separate file just only because of the modify_resolvconf script. There were no other reasons.
See Bug 55610, comment #13 (2004-07-26) and later (some discussion went out of bugzilla).
Comment 7 Peter Poeml 2006-02-09 14:25:18 UTC
It works fine on a 9.2, for example. Maybe I didn't use it on newer
systems. I was not aware of the change in bind configuration.
Comment 8 Christian Zoz 2006-02-13 15:13:52 UTC
OK, we now modify /etc/named.d/forwarders.conf

Will be in beta4.
Comment 9 Christian Zoz 2006-05-12 11:57:39 UTC
This does not work at all.

modify_resolvconf does not create forwarders.conf if this file does not exist. This is intention, because a forwarders.conf wich is not included in named.conf is useless.

YaST DNS Server does not create forwarders.conf (and the include) if i select 'change fw via ppp'. And if i select static forwarders i don't want it to modufied dynamically.
Comment 10 Christian Zoz 2006-05-12 11:58:26 UTC
*** Bug 173407 has been marked as a duplicate of this bug. ***
Comment 11 Christian Zoz 2006-05-12 12:06:33 UTC
YaST2 DNS server sets MODIFY_*_CONF_DYNAMICALLY properly, but it does neither
create a forwarders.conf nor does it add an include statement for this file.

Further, this all cannot work if bind is configured manually, because nobody knows that he has to use forwarders.conf

Thus, it was completely wrong to change modify_resolvconf. I will change that back in a YOUpdate.
Comment 12 Lukas Ocilka 2006-05-12 13:16:37 UTC
y2log:
Moving forwarders into single file /etc/named.d/forwarders.conf
Writing forwarders to file /etc/named.d/forwarders.conf

cat /etc/named.d/forwarders.conf
--- out ---
# Copyright (c) 2001-2004 SuSE Linux AG, Nuernberg, Germany.
# All rights reserved.
# Forwarders file for PPPD updates (only)
#
# /etc/named.d/forwarders.conf 

forwarders { 10.20.0.2; };
--- out ---

grep "/etc/named.d/forwarders.conf" /etc/named.conf
--- out ---
        include "/etc/named.d/forwarders.conf";
--- out ---

so, to comment #9:
file exists when YaST is used for the configuration
file is "included" in named.conf in the same case
YaST DNS Server creates the forwarders file

to comment #11:
manual configuration is not a supported feature, you a user creates his manual configuration and includes forwarders in the named.conf, YaST would move them into that separate file after tries to change the configuration with YaST.

It behaves as it was defined in the bug 55610. According to comment #26 we might need to add that file into the default configuration but for me, this is INVALID or WORKSFORME.
Comment 13 Christian Zoz 2006-05-12 13:58:15 UTC
I just used YaST2 DNS Server and was choosing 'PPP Daemon Sets Forwarders'. Then MODIFY_*_CONF_DYNAMICALLY was properly set but there was no forwarders.conf. You have to create it also if 'PPP Daemon Sets Forwarders' is choosen. Add an empty forwarders line then.
Comment 14 Lukas Ocilka 2006-05-12 14:00:03 UTC
OK, gimme yast logs, please.
But I've tried both cases and both created that file...
Comment 15 Christian Zoz 2006-05-12 14:18:45 UTC
Created attachment 83242 [details]
last 1000 lines of y2log
Comment 16 Lukas Ocilka 2006-05-12 14:29:09 UTC
OK, please, attach also the /etc/named.conf file :)

It appears that there are no forwarders defined so the file is not written at all.
Comment 17 Christian Zoz 2006-05-12 14:42:16 UTC
Exactly that. named.conf was fresh from bind.rpm and not modified.
When i get forwarders via ppp i have no static one. 

modify_resolvconf expects at least an empty or commented forwarders line. Like it is in default named.conf. Otherwise it won't add one.
Comment 18 Lukas Ocilka 2006-05-12 14:42:39 UTC
Confirmed by my tests
-> forwarfders file is not created when there is nothing to write into.

On the other hand, is it really the expected (who expects it?) behavior to write the file allways :)?
Comment 19 Christian Zoz 2006-05-12 14:45:54 UTC
modify_resolvconf could (it does not currently) create the file if it doesn't exist. But i don't want to have to add the include line in named.conf. So it would be nice if you could create both. 

We should add that to the default named.conf already. Then modify_resolvconf will work with manually created configurations as well.
Comment 20 Lukas Ocilka 2006-05-12 14:48:13 UTC
If you use that feature "modify resolv conf" it is still not going to work until you call YaST to create it, right. In this view, it should be added (empty) into the default configuration.

[I see you have written almost the same ;)]

Lars?
Comment 21 Lukas Ocilka 2006-05-15 07:56:19 UTC
- Special file /etc/named.d/forwarders.conf is allways written and
  included in the configuration of /etc/named.conf because of the
  feature 'PPP daemon sets forwarders'. The file is allways written
  even the list of forwarders is empty (#134692).
- yast2-dns-server-2.13.12

So this is fixed for me.

Lars, please, include the empty file /etc/named.d/forwarders.conf in the bind package if possible and create and 'include' in the /etc/named.conf. Thanks.

--- cut ---
options {
    ...
    include "/etc/named.d/forwarders.conf";
    ...
}
--- cut ---

--- /etc/named.d/forwarders.conf ---
# Copyright (c) 2001-2004 SuSE Linux AG, Nuernberg, Germany.
# All rights reserved.
# Forwarders file for PPPD updates (only)
#
# /etc/named.d/forwarders.conf 

forwarders {};
--- /etc/named.d/forwarders.conf ---
Comment 24 Gernot Hillier 2007-02-03 10:35:34 UTC
It seems this is still not fixed properly in 10.2. 

For some reason, I ended up with an empty /etc/named.d/forwarders.conf file after an update 10.1->10.2. I also only get name servers dynamically (in this case even with a VPN tunnel).

So here's what I would suggest to change:

1) modify_resolvconf: If forwarders.conf exists but doesn't contain the "forwarders {}" line, modify_resolvconf replaces this file, writes a nice header, but your name server is simply not added. So everything looks correct, but it's not working finally. I think this case shall be checked in modify_resolvconf and a warning produced in modify_resolvconf.

2) Further on, /etc/sysconfig/network/config still says that enabling MODIFY_NAMED_CONF_DYNAMICALLY means it will change /etc/named.conf which is quite misleading.

3) To fix all that stuff I just deleted forwarders.conf as it wasn't provided by  the bind-utils package. So please add it to the package as suggested in the last comment.
Comment 25 Christian Zoz 2007-02-03 12:23:59 UTC
1) I won't change modify_resolvconf, since it will become obsolete soon. We are heading for NetworkManager (SUSE enhanced NM of course). I don't want to spend my time with fixing rare problems. --> WONTFIX from my side

2) Fixed comment.

3) That's up to Uwe.
Comment 26 Gernot Hillier 2007-02-04 20:36:04 UTC
Wow, now I'm totally confused. I just found that /etc/named.d/forwarders.conf isn't included any more by default in /etc/named.conf. It's also not working if I include it in /etc/sysconfig/named:NAMED_CONF_INCLUDE_FILES because these files are included out of the scope of options{};. And it won't end up in the chroot environment which is enabled by default if I don't put it there...

So I start to think that the combination modify_resolvconf/bind isn't working at all for SUSE 10.2, right? I'm not sure whether this is a "rare problem", but well...

I'd also say that it makes no sense to fix 3) if we won't have 1) fixed. As forwarders.conf was only invented because of modify_resolvconf it also doesn't make sense any more to add it to the package if modify_resolvconf is dying, right?
Comment 27 Gernot Hillier 2007-02-04 20:51:57 UTC
Ok, the include for forwarders.conf is added to named.conf if one walks through the YaST named configuration once. Not very intuitive, but ok...

So only my last paragraph stays valid: I'd suggest to either fix 1) + 3) or neither of both makes sense...
Comment 28 Uwe Gansert 2007-09-14 11:38:42 UTC
#25 and #27 -> wontfix
Comment 29 Peter Poeml 2007-09-25 10:48:49 UTC
I find the following on two 10.1 machines, when I research why DNS
resolution works badly:


Sep 25 03:30:03 zeus modify_resolvconf: Service pppd tried to modify /etc/named.d/forwarders.conf, but named seems not to be installed
Sep 25 03:30:03 zeus modify_resolvconf: Check your settings of MODIFY_RESOLV\NAMED_CONF_DYNAMICALLY


If this is really a "wontfix" (which I don't really understand [*]),
what is the expected way to work around this problem? Could it be
documented?


[*] Couldn't modify_resolvconf simply modify /etc/named.conf if
/etc/named.d/forwarders.conf doesn't exist?
Comment 31 Christian Zoz 2007-12-19 11:30:25 UTC
Package sysconfig is now maintained by Marius Tomaschewski
Comment 32 Marius Tomaschewski 2009-02-13 16:31:31 UTC
Created attachment 272729 [details]
Proposed /sbin/modify_resolvconf fixes for forwarders.conf creation

I found a little bit time to fix modify_resolvconf so far.

 - Check if the directory exists instead of forwarders.conf,
   so when there is no forwarders.conf but named is installed,
   it will be created.
 - Fixed creation of the forwarders.conf to not to expect any
   options block. [There is still legacy code in case the user
   changed NAMEDCONF back to /etc/named.conf].
 - Add debug message about missed inclusion in /etc/named.conf
   [IMO it is not needed to flood the logs with this and yast2
    adds the include statement as far as I read the comments
    correctly].

Too late for 10.2 but may go into 10.3 and 11.0 or sles10 sp3
updates... I'll submit test packages to build.opensuse.org at
home:mtomaschewski:<version>/sysconfig soon.

The comment in sysconfig, that the /etc/named.d/forwarders.conf
is modified is fixed at least on >= 10.3.

(In reply to comment #29)
[...]
> I find the following on two 10.1 machines, when I research why
> DNS resolution works badly:

Yes.

A 'echo 'forwarders {};' > /etc/named.d/forwarders.conf" IMO fixed
the problem in the past, the patch fixes it now too.

Modifying of /etc/named.conf is a bad idea because of many reasons
that are referenced in this bug report [one is, it may be not in
options but in a zone block ;-)], but you can adjust the NAMEDCONF
variable in /sbin/modify_resolvconf if you really want go back.
Comment 35 Marius Tomaschewski 2009-02-16 16:09:21 UTC
Test packages are in:

http://download.opensuse.org/repositories/home://mtomaschewski://10.3/openSUSE_10.3/
http://download.opensuse.org/repositories/home://mtomaschewski://11.0/openSUSE_11.0/

Note:
it has to be build on 16-Feb-2009 or later / see changelog in the
repodata subdirectory.
Comment 36 Marius Tomaschewski 2009-04-09 10:30:07 UTC
submitted: 10.3, 11.0, sles10
Comment 38 Swamp Workflow Management 2009-04-16 13:28:29 UTC
Update released for: sysconfig
Products:
openSUSE 10.3 (i386, ppc, x86_64)
Comment 39 Swamp Workflow Management 2009-04-16 13:29:11 UTC
Update released for: sysconfig
Products:
openSUSE 11.0 (debug, i386, ppc, x86_64)
Comment 40 Swamp Workflow Management 2009-05-04 22:09:47 UTC
Update released for: sysconfig
Products:
SLE-DEBUGINFO 10-SP2 (i386, ia64, ppc, s390x, x86_64)
SLE-DESKTOP 10-SP2 (i386, x86_64)
SLE-RT 10-SP2 (i386, x86_64)
SLE-SERVER 10-SP2 (i386, ia64, ppc, s390x, x86_64)