Bug#637285: openresolv: dns-domain dns-sortlist in the interfaces file is not getting into resolv.conf

2011-08-11 Thread Alex Apke
---BeginMessage---
I have a server with a default internal IP address, and a local name
defined in /etc/hosts for one network interface, but the second
interface is on the public network. So I want the domain name of the
server to be set to the public name, not the default internal one.

 The eth0 and eth1 stanza's you mention are example files sent to
 resolv.conf - not the final /etc/resolv.conf that ends up. Which local
 resolver are you using? Some require a little configuration to use
 openresolv.
 
I have bind9 running locally, and am using the libc resolver, so
there shouldn't be too much extra needed.

 Here's a patch which addresses the sortlist option which is indeed an
 issue.
 http://roy.marples.name/cgi-bin/gitweb.cgi?p=openresolv.git;a=commitdiff;h=98068bb3b35c1af98226adedbaa263ffdc14d775
 
 I'll do another release based on feedback on the domain issue above.
 
 Thanks
 
 Roy



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org

---End Message---


Bug#637285: openresolv: dns-domain dns-sortlist in the interfaces file is not getting into resolv.conf

2011-08-11 Thread Roy Marples

Hi Alex

On 11/08/2011 06:30, Alex Apke wrote:

domain is missing because search supersedes it. Any domain entries are
silently merged with the search option. Is there a problem with this?


 From a resolver search standpoint, there is no problem appending the
domain entry to search field. But I believe the domain value in
resolv.conf is used to set the machine's domain name (hostname -d),
this is now lost in openresolv compared to what resolvconf did.

I have a server with a default internal IP address, and a local name
defined in /etc/hosts for one network interface, but the second
interface is on the public network. So I want the domain name of the
server to be set to the public name, not the default internal one.


According to hostname(1) the DNS domain name is fetched via 
getaddrinfo(3) which in turn just used the information in /etc/resolv.conf


Also, note this in resolv.conf(5)
The domain and search keywords are mutually exclusive.   If  more  than
one instance of these keywords is present, the last instance wins.

Lastly, looking over the original resolvconf code it just merges it all 
into search as well so openresolv is mirroring the behaviour.



The eth0 and eth1 stanza's you mention are example files sent to
resolv.conf - not the final /etc/resolv.conf that ends up. Which local
resolver are you using? Some require a little configuration to use
openresolv.


I have bind9 running locally, and am using the libc resolver, so
there shouldn't be too much extra needed.


AFAIK bind9 on Debian doesn't have any resolvconf hooks other than 
sending the loopback address as a nameserver to resolvconf. So to get 
the stanzas working as described on my homepage, you'll need to 
configure /etc/resolvconf.conf to write out two files for named and 
update your named configuration to include these two files. See the 
below links for details.


http://roy.marples.name/projects/openresolv/wiki/OpenResolvConfig
http://roy.marples.name/projects/openresolv/wiki/OpenResolvConfigBind

You should note that the sample Bind config listed probably isn't 
suitable for Debian - it just serves as an example of how to include the 
two files needed.


Thanks

Roy



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#637285: openresolv: dns-domain dns-sortlist in the interfaces file is not getting into resolv.conf

2011-08-11 Thread Alex Apke

On Aug 11, 2011, at 1:32 AM, Roy Marples wrote:

 Hi Alex
 
 On 11/08/2011 06:30, Alex Apke wrote:
 domain is missing because search supersedes it. Any domain entries are
 silently merged with the search option. Is there a problem with this?
 
 From a resolver search standpoint, there is no problem appending the
 domain entry to search field. But I believe the domain value in
 resolv.conf is used to set the machine's domain name (hostname -d),
 this is now lost in openresolv compared to what resolvconf did.
 
 I have a server with a default internal IP address, and a local name
 defined in /etc/hosts for one network interface, but the second
 interface is on the public network. So I want the domain name of the
 server to be set to the public name, not the default internal one.
 
 According to hostname(1) the DNS domain name is fetched via getaddrinfo(3) 
 which in turn just used the information in /etc/resolv.conf
 
 Also, note this in resolv.conf(5)
 The domain and search keywords are mutually exclusive.   If  more  than
 one instance of these keywords is present, the last instance wins.

So that means that having a domain entry listed before search gives the desired 
behavior, I am looking for. 

With the original sample I used for opening the ticket, this is the expected 
layout:
# Generated by resolvconf
domain example.com
search foo bar example.com
nameserver 127.0.0.1
nameserver 192.168.0.2
nameserver 8.8.8.8
nameserver 8.8.4.4
options timeout:5
sortlist 130.155.160.0/255.255.240.0 130.155.0.0

The resolver will ignore domain, and use search, which will have the domain 
appended to it.

 Lastly, looking over the original resolvconf code it just merges it all into 
 search as well so openresolv is mirroring the behavior.

I could have sworn the behavior was different. Perhaps I had kept domain in as 
a static entry for resolvconf, that kept domain entry in the file.

 The eth0 and eth1 stanza's you mention are example files sent to
 resolv.conf - not the final /etc/resolv.conf that ends up. Which local
 resolver are you using? Some require a little configuration to use
 openresolv.
 
 I have bind9 running locally, and am using the libc resolver, so
 there shouldn't be too much extra needed.
 
 AFAIK bind9 on Debian doesn't have any resolvconf hooks other than sending 
 the loopback address as a nameserver to resolvconf. So to get the stanzas 
 working as described on my homepage, you'll need to configure 
 /etc/resolvconf.conf to write out two files for named and update your named 
 configuration to include these two files. See the below links for details.
 
 http://roy.marples.name/projects/openresolv/wiki/OpenResolvConfig
 http://roy.marples.name/projects/openresolv/wiki/OpenResolvConfigBind
 
 You should note that the sample Bind config listed probably isn't suitable 
 for Debian - it just serves as an example of how to include the two files 
 needed.
 Thanks
 
 Roy

I will have a look at those configs, thanks.


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#637285: openresolv: dns-domain dns-sortlist in the interfaces file is not getting into resolv.conf

2011-08-11 Thread Roy Marples

On 11/08/2011 09:58, Alex Apke wrote:

So that means that having a domain entry listed before search gives the desired 
behavior, I am looking for.

With the original sample I used for opening the ticket, this is the expected 
layout:
# Generated by resolvconf
domain example.com
search foo bar example.com
nameserver 127.0.0.1
nameserver 192.168.0.2
nameserver 8.8.8.8
nameserver 8.8.4.4
options timeout:5
sortlist 130.155.160.0/255.255.240.0 130.155.0.0

The resolver will ignore domain, and use search, which will have the domain 
appended to it.


In the above example, the domain will be foo because it's the first in 
the list


domain foo
search bar foo
domain foo

That sets the domain to foo and blanks the search list because domain 
was last. The libc source code will use the last domain or search 
statement it finds and use that for all. So when it comes to the 
generated resolv.conf file, having a domain keyword is pretty redundant.


It looks like the behaviour you really want is the correct domain first 
in the search list.
You can do this by setting interface_order and/or dynamic_order and/or 
search_domains in /etc/resolvconf.conf


Thanks

Roy



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#637285: openresolv: dns-domain dns-sortlist in the interfaces file is not getting into resolv.conf

2011-08-11 Thread Alex Apke

On Aug 11, 2011, at 3:34 AM, Roy Marples wrote:

 On 11/08/2011 09:58, Alex Apke wrote:
 So that means that having a domain entry listed before search gives the 
 desired behavior, I am looking for.
 
 With the original sample I used for opening the ticket, this is the expected 
 layout:
 # Generated by resolvconf
 domain example.com
 search foo bar example.com
 nameserver 127.0.0.1
 nameserver 192.168.0.2
 nameserver 8.8.8.8
 nameserver 8.8.4.4
 options timeout:5
 sortlist 130.155.160.0/255.255.240.0 130.155.0.0
 
 The resolver will ignore domain, and use search, which will have the domain 
 appended to it.
 
 In the above example, the domain will be foo because it's the first in the 
 list
 
 domain foo
 search bar foo
 domain foo
 
 That sets the domain to foo and blanks the search list because domain was 
 last. The libc source code will use the last domain or search statement it 
 finds and use that for all. So when it comes to the generated resolv.conf 
 file, having a domain keyword is pretty redundant.

In my original example dns-domain foo is commented out.

So here is how I see this all working for libc resolver, and will only show the 
interfaces  resulting resolv.conf entries for domain  search.

1)
interfaces
dns-search foo bar
dns-domain example.com
resolv.conf
domain example.com
search foo bar example.com

2)
interfaces
dns-domain foo
dns-search bar
dns-domain example.com
resolv.conf
domain example.com
search bar foo example.com

3)
interfaces
dns-search foo
dns-domain example.com
dns-search bar
resolv.conf
domain example.com
search foo example.com bar

4)
interfaces
dns-search foo bar
dns-search example.com
resolv.conf
search foo bar example.com

In the above, the domain value always gets added to search, but if domain 
appears in the interfaces file, it should only appear in the resolv.conf once, 
and always above the search entry. For examples 2  3, openresolv could build 
the search list differently or choose the other domain to be displayed.

 
 It looks like the behaviour you really want is the correct domain first in 
 the search list.
 You can do this by setting interface_order and/or dynamic_order and/or 
 search_domains in /etc/resolvconf.conf

Sure, as a backup procedure, there is always that, but I still think it would 
be possible for openresolv to do what I am suggesting above.




--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#637285: openresolv: dns-domain dns-sortlist in the interfaces file is not getting into resolv.conf

2011-08-11 Thread Roy Marples

On 11/08/2011 17:18, Alex Apke wrote:

It looks like the behaviour you really want is the correct domain
first in the search list. You can do this by setting
interface_order and/or dynamic_order and/or search_domains in
/etc/resolvconf.conf


Sure, as a backup procedure, there is always that, but I still think
it would be possible for openresolv to do what I am suggesting
above.


Sure it's possible.
My question is, what technical issue does it solve?

Thanks

Roy



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#637285: openresolv: dns-domain dns-sortlist in the interfaces file is not getting into resolv.conf

2011-08-11 Thread Alex Apke

On Aug 11, 2011, at 10:33 AM, Roy Marples wrote:

 On 11/08/2011 17:18, Alex Apke wrote:
 It looks like the behaviour you really want is the correct domain
 first in the search list. You can do this by setting
 interface_order and/or dynamic_order and/or search_domains in
 /etc/resolvconf.conf
 
 Sure, as a backup procedure, there is always that, but I still think
 it would be possible for openresolv to do what I am suggesting
 above.
 
 Sure it's possible.
 My question is, what technical issue does it solve?
 

Didn't you say that hostname will eventually lookup the domain name from 
resolv.conf if not defined elsewhere in one of the previous emails? That's the 
assumption I am basing the request on. Not to use domain in resolv.conf for 
resolution, but for setting of the dns domain name of the box.

But after some more digging, it's only /etc/hosts that is used for setting the 
dns domain name by looking up the name defined in /etc/hostname.


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#637285: openresolv: dns-domain dns-sortlist in the interfaces file is not getting into resolv.conf

2011-08-10 Thread Alex Apke
Package: openresolv
Version: 3.4.4-2
Severity: normal

I am not sure if this is a bug in openresolv or in the ifupdown package, but
it doesn't appear that the /etc/network/if-up.d/000resolvconf field entry to
set the domain or sortlist in /etc/resolv.conf from /etc/network/interfaces
is working.

In various ifupdown documentation  openresolv scripts I found that that
dns-domain, dns-sortlist are valid parameters for the interfaces file, 
in addition to dns-search, dns-nameservers, and dns-options.


BTW: the version of ifupdown that I have tested is: 0.7~alpha5.1
0.7~alpha5+really0.6.10, ifupdown-extra is installed as well: 0.18

here is a sample complex interfaces file excerpt:
auto eth0
iface eth0 inet static
address 192.168.0.3
network 192.168.0.0
netmask 255.255.255.0
broadcast 192.168.0.255
#   dns-domain foo
dns-search foo bar
dns-nameservers 192.168.0.2
dns-options timeout:5
dns-sortlist 130.155.160.0/255.255.240.0 130.155.0.0

auto eth1
iface eth1 inet static
address 192.0.43.10
network 192.0.43.0
netmask 255.255.255.0
broadcast 192.0.43.255
gateway 192.0.43.1
dns-domain example.com
dns-nameservers 8.8.8.8 8.8.8.4

Will result in the following /etc/resolv.conf (Note: local ns installed)
$ cat /etc/resolv.conf 
# Generated by resolvconf
search foo bar example.com
nameserver 127.0.0.1
nameserver 192.168.0.2
nameserver 8.8.8.8
nameserver 8.8.4.4
options timeout:5


domain  sortlist are missing, and the domain value is being appended to
search, plus the eth0  eth1 stanza's aren't broken up like in the following
URL: http://roy.marples.name/projects/openresolv/wiki/OpenResolvReasons

Thanks

-- System Information:
Debian Release: 6.0.2
  APT prefers stable
  APT policy: (990, 'stable'), (500, 'unstable'), (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 3.0.0-1-686-pae (SMP w/1 CPU core)
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/bash

-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#637285: openresolv: dns-domain dns-sortlist in the interfaces file is not getting into resolv.conf

2011-08-10 Thread Roy Marples
Hi Alex

On Wed, 2011-08-10 at 00:15 -0700, Alex Apke wrote:
 domain  sortlist are missing, and the domain value is being appended to
 search, plus the eth0  eth1 stanza's aren't broken up like in the following
 URL: http://roy.marples.name/projects/openresolv/wiki/OpenResolvReasons

domain is missing because search supersedes it. Any domain entries are
silently merged with the search option. Is there a problem with this?

The eth0 and eth1 stanza's you mention are example files sent to
resolv.conf - not the final /etc/resolv.conf that ends up. Which local
resolver are you using? Some require a little configuration to use
openresolv.

Here's a patch which addresses the sortlist option which is indeed an
issue.
http://roy.marples.name/cgi-bin/gitweb.cgi?p=openresolv.git;a=commitdiff;h=98068bb3b35c1af98226adedbaa263ffdc14d775

I'll do another release based on feedback on the domain issue above.

Thanks

Roy




-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org