Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Doesn't give me any records
Avatar
LonelyPixel #1
Member since May 2006 · 10 posts · Location: Eckental, DE
Group memberships: Members
Show profile · Link to this post
Subject: DNS SRV query
Hi,
this is probably a little OT but I have a problem with the DNS resolver classes of agsXMPP.

I'm currently working on an e-mail application that should later be extended by XMPP capabilities. Right now, I'm trying to do something like an e-mail server auto-configuration. This means that the user just enters their e-mail address and password and the system automatically finds their POP and IMAP server. I thought that SRV records would be an ideal way to do that, and so I added a bunch of those records to my own domain and wanted to start on a simple implementation.

I found one in the agsXMPP.net.dns namespace, so I just copied all the files into my project and tried them out. But the results are not like expected... I see that my own SRV records aren't spread yet but there should be some for gmail.com and amessage.de, right? (Although 'dig srv ...' doesn't show me any...) When I call the Resolver.SRVLookup method, I always get zero replies. Not a single SRV record. Are there really no records or am I doing something wrong? The DNS server was detected correctly and points to my local FritzBox. The server returns 512 bytes of UDP data but it says there are no records in it. From the source code, I can't say it would be restricted to _xmpp records, so it should give me all records, also my new _pop3, _imap4, etc., right?

Anybody an idea?
Avatar
LonelyPixel #2
Member since May 2006 · 10 posts · Location: Eckental, DE
Group memberships: Members
Show profile · Link to this post
Ah, I see, it works another way. If I do a 'dig' query on the actual "hostname", I get the SRV records, too. Meaning I need to query for _xmpp-client._tcp.gmail.com for example, or in my case for _pop3._tcp.mydomain.de.

Now that I've updated my DNS hostfile again and query the correct name from my code, I even get a reply! So it works now... :)
Avatar
Alex #3
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
You can also use the DNS API from windows with PInvoke pretty easy. But we wanted to have a fully managed and cross platform solution. And i think it works quite very well.

Alex
Avatar
LonelyPixel #4
Member since May 2006 · 10 posts · Location: Eckental, DE
Group memberships: Members
Show profile · Link to this post
Oh, your class works fine! :) Now that I found out how to use it.

From what I've found now, the Windows DNS API is only available from Win2k Pro on, which is not exactly what my intention was. Also it looks complicated, the documentation (in MSDN) is broken and incomplete. I'm now looking into extending your class to support MX records (for a final fallback guess). I'll see if that works...
Avatar
Alex #5
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
parts of the code is from codeproject. I changed it a bit and extended it for SRV records. So you should lookup the code at codeproject and the MX stuff will be there ;-)

I think it was that one:
http://www.codeproject.com/cs/internet/dnslookupdotnet.asp

i tried to contact the author several times to submit bugfixes and extensions, but there was no feedback.

There is lib which is using the WinApi:
http://www.aspemporium.com/classes.aspx?cid=7
I think you have to distribute only one dll to get it working on systems < win2k (no idea if the MS licence allows that).

Alex
Avatar
LonelyPixel #6
Member since May 2006 · 10 posts · Location: Eckental, DE
Group memberships: Members
Show profile · Link to this post
Thank you, I found the MXRecord code there and could integrate it (with small modifications). Works fine. :)
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: agsXMPP RSS