Re: [Samba] Samba4 DNS: "recursion requested but not available"

2013-01-29 Thread Kai Blin
On 2013-01-29 14:37, Thomas Simmons wrote:

Hi Thomas,

> Do you know if this will be fixed in 4.0.2? Thanks.

I'm afraid I didn't get around to work on this yet. I'll update the bug
report as soon as I have some new patches.

Sorry for the inconvenience,
Kai


-- 
Kai Blin
Worldforge developer http://www.worldforge.org/
Wine developer http://wiki.winehq.org/KaiBlin
Samba team member http://www.samba.org/samba/team/
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


Re: [Samba] Samba4 DNS: "recursion requested but not available"

2013-01-29 Thread Thomas Simmons
Hello Kai,

Do you know if this will be fixed in 4.0.2? Thanks.


On Fri, Jan 18, 2013 at 6:38 AM, Kai Blin  wrote:

> On 2013-01-17 19:27, Thomas Simmons wrote:
>
> Hi Thomas,
>
> > Has this problem been fixed? It looks like the patch referenced above had
> > issues, but there were no further follow-ups in bugzilla.
>
> I'm still trying to figure out why the proposed patch doesn't work.
> Currently I'm getting a better debugging infrastructure in place for all
> things DNS, I'm hoping to tackle this issue next.
>
> My current state is at
> https://gitweb.samba.org/?p=kai/samba.git;a=shortlog;h=refs/heads/bug9485but
> note that this currently has the same issues as the patch on bug #9485.
>
> Cheers,
> Kai
>
> --
> Kai Blin
> Worldforge developer http://www.worldforge.org/
> Wine developer http://wiki.winehq.org/KaiBlin
> Samba team member http://www.samba.org/samba/team/
>
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


Re: [Samba] Samba4 DNS: "recursion requested but not available"

2013-01-18 Thread Kai Blin
On 2013-01-17 19:27, Thomas Simmons wrote:

Hi Thomas,

> Has this problem been fixed? It looks like the patch referenced above had
> issues, but there were no further follow-ups in bugzilla.

I'm still trying to figure out why the proposed patch doesn't work.
Currently I'm getting a better debugging infrastructure in place for all
things DNS, I'm hoping to tackle this issue next.

My current state is at
https://gitweb.samba.org/?p=kai/samba.git;a=shortlog;h=refs/heads/bug9485 but
note that this currently has the same issues as the patch on bug #9485.

Cheers,
Kai

-- 
Kai Blin
Worldforge developer http://www.worldforge.org/
Wine developer http://wiki.winehq.org/KaiBlin
Samba team member http://www.samba.org/samba/team/
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


Re: [Samba] Samba4 DNS: "recursion requested but not available"

2013-01-17 Thread Thomas Simmons
https://lists.samba.org/archive/samba/2012-December/170381.html

https://bugzilla.samba.org/show_bug.cgi?id=9485


On Thu, Jan 17, 2013 at 1:27 PM, Thomas Simmons  wrote:

> Hello,
>
> Has this problem been fixed? It looks like the patch referenced above had
> issues, but there were no further follow-ups in bugzilla.
>
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


Re: [Samba] Samba4 DNS: "recursion requested but not available"

2013-01-17 Thread Thomas Simmons
Hello,

Has this problem been fixed? It looks like the patch referenced above had
issues, but there were no further follow-ups in bugzilla.
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


Re: [Samba] Samba4 DNS: "recursion requested but not available"

2012-12-09 Thread Michael B. Trausch

On 12/09/2012 02:57 PM, Kai Blin wrote:

This clearly is a bug in the DNS server. Attached is a patch that
should fix MX queries for both the 4.0 release branch and master.
I'm afraid we just missed the window for the 4.0.0 release, but I've
opened bug #9485 in Samba Bugzilla to track this bug and get it in for
the next bugfix release.


Thanks for the patch; I will apply it tonight and let you know.  Irony 
is that this was found when I set up a lab environment; my production 
environment doesn't have MX records in the Samba server!  :)



Thanks for the catch and sorry for any inconvenience.


No worries.  Bugs happen, it's how they're dealt with that matters.  Thanks!

--- Mike

--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


Re: [Samba] Samba4 DNS: "recursion requested but not available"

2012-12-09 Thread Kai Blin
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 2012-12-09 08:37, Michael B. Trausch wrote:

Hi Mike,

> I am trying to get mail working for a subdomain that is being
> managed by Samba 4.  I added an MX record, but the problem here is
> that the Samba 4 DNS server isn't replying with the record:
> 
> =
>
> 
[mbt@aloe ~]$ dig -t MX nautest.naunetcorp.com @s4.nautest.naunetcorp.com
> 
> ; <<>> DiG 9.9.2-P1-RedHat-9.9.2-5.P1.fc18 <<>> -t MX 
> nautest.naunetcorp.com @s4.nautest.naunetcorp.com ;; global
> options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status:
> NOTIMP, id: 5782
 ^^
This one is the important bit. MX queries return NOTIMP. I'm a bit
surprised about that because I was sure I had seen code in the dns
update logc handling this. But apparently I forgot to add code to the
query logic to actually return MX records. Sorry.


> ;; flags: qr rd ad; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL:
> 1 ;; WARNING: recursion requested but not available

This is just caused by our error handling code not bothering to set
the 'recursion available' bit on error replies.

> The query should return the name and priority of the MX server that
> I have defined.  The MX shows up in the "samba-tool dns query"
> output, so it's just the DNS server that isn't responding
> correctly.
> 
> Is this a bug, or is this the result of something I've done wrong?

This clearly is a bug in the DNS server. Attached is a patch that
should fix MX queries for both the 4.0 release branch and master.
I'm afraid we just missed the window for the 4.0.0 release, but I've
opened bug #9485 in Samba Bugzilla to track this bug and get it in for
the next bugfix release.

Thanks for the catch and sorry for any inconvenience.
Kai

- -- 
Kai Blin
Worldforge developer http://www.worldforge.org/
Wine developer http://wiki.winehq.org/KaiBlin
Samba team member http://www.samba.org/samba/team/
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iEYEARECAAYFAlDE7Q0ACgkQEKXX/bF2FpR9pgCfeV1AFdWyF2zHGCZXvy4LcgJ6
SYYAn04b4BCtCCc6oE/+zxA+fxu2S/49
=rGcM
-END PGP SIGNATURE-
>From e6b772c3215c3cf677e0268c7283f5b0e6e75abf Mon Sep 17 00:00:00 2001
From: Kai Blin 
Date: Mon, 10 Dec 2012 05:50:05 +1000
Subject: [PATCH] dns: Add support for MX queries

Due to an oversight, the internal DNS server supports MX record updates,
but not MX record queries. Add support for MX queries and tests.

This should fix bug #9485

Signed-off-by: Kai Blin 
---
 source4/dns_server/dns_query.c  |8 +
 source4/scripting/python/samba/tests/dns.py |   42 +++
 2 files changed, 50 insertions(+), 0 deletions(-)

diff --git a/source4/dns_server/dns_query.c b/source4/dns_server/dns_query.c
index 54e0c7f..75f0e9f 100644
--- a/source4/dns_server/dns_query.c
+++ b/source4/dns_server/dns_query.c
@@ -89,6 +89,14 @@ static WERROR create_response_rr(const struct dns_name_question *question,
 	case DNS_QTYPE_PTR:
 		ans[ai].rdata.ptr_record = talloc_strdup(ans, rec->data.ptr);
 		break;
+	case DNS_QTYPE_MX:
+		ans[ai].rdata.mx_record.preference = rec->data.mx.wPriority;
+		ans[ai].rdata.mx_record.exchange = talloc_strdup(
+			ans, rec->data.mx.nameTarget);
+		if (ans[ai].rdata.mx_record.exchange == NULL) {
+			return WERR_NOMEM;
+		}
+		break;
 	case DNS_QTYPE_TXT:
 		tmp = talloc_asprintf(ans, "\"%s\"", rec->data.txt.str[0]);
 		W_ERROR_HAVE_NO_MEMORY(tmp);
diff --git a/source4/scripting/python/samba/tests/dns.py b/source4/scripting/python/samba/tests/dns.py
index 49d699e..d01c8ff 100644
--- a/source4/scripting/python/samba/tests/dns.py
+++ b/source4/scripting/python/samba/tests/dns.py
@@ -510,6 +510,48 @@ class TestDNSUpdates(DNSTest):
 response = self.dns_transaction_udp(p)
 self.assert_dns_rcode_equals(response, dns.DNS_RCODE_NXDOMAIN)
 
+def test_update_add_mx_record(self):
+"test adding MX records works"
+p = self.make_name_packet(dns.DNS_OPCODE_UPDATE)
+updates = []
+
+name = self.get_dns_domain()
+
+u = self.make_name_question(name, dns.DNS_QTYPE_SOA, dns.DNS_QCLASS_IN)
+updates.append(u)
+self.finish_name_packet(p, updates)
+
+updates = []
+r = dns.res_rec()
+r.name = "%s" % self.get_dns_domain()
+r.rr_type = dns.DNS_QTYPE_MX
+r.rr_class = dns.DNS_QCLASS_IN
+r.ttl = 900
+r.length = 0x
+r.rdata = dns.mx_record()
+r.rdata.preference = 10
+r.rdata.exchange = 'mail.%s' % self.get_dns_domain()
+updates.append(r)
+p.nscount = len(updates)
+p.nsrecs = updates
+
+response = self.dns_transaction_udp(p)
+self.assert_dns_rcode_equals(response, dns.DNS_RCODE_OK)
+
+p = self.make_name_packet(dns.DNS_OPCODE_QUERY)
+questions = []
+
+n

[Samba] Samba4 DNS: "recursion requested but not available"

2012-12-08 Thread Michael B. Trausch

Hello all,

This is with Samba 4.0.0rc6 with the built-in DNS server.  Found the 
problem in Samba 4.0.0rc5 originally, then updated to see if bug had 
been fixed between rc5 and rc6.


I am trying to get mail working for a subdomain that is being managed by 
Samba 4.  I added an MX record, but the problem here is that the Samba 4 
DNS server isn't replying with the record:


=
[mbt@aloe ~]$ dig -t MX nautest.naunetcorp.com @s4.nautest.naunetcorp.com

; <<>> DiG 9.9.2-P1-RedHat-9.9.2-5.P1.fc18 <<>> -t MX 
nautest.naunetcorp.com @s4.nautest.naunetcorp.com

;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOTIMP, id: 5782
;; flags: qr rd ad; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; WARNING: recursion requested but not available

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;nautest.naunetcorp.com.IN  MX

;; Query time: 2 msec
;; SERVER: 2001:470:c0a7:6::2#53(2001:470:c0a7:6::2)
;; WHEN: Sat Dec  8 16:21:38 2012
;; MSG SIZE  rcvd: 51
=

The query should return the name and priority of the MX server that I 
have defined.  The MX shows up in the "samba-tool dns query" output, so 
it's just the DNS server that isn't responding correctly.


Is this a bug, or is this the result of something I've done wrong?

Thanks,

Mike

--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba