|Subject:||Re: iddnsresolver demo/examples??|
|Posted by:||Remy Lebeau (TeamB) (firstname.lastname@example.org)|
|Date:||Thu, 30 Oct 2003|
"Anthony" <antho…@n.o.s.p.a.m.caltec.co.uk> wrote in message
> Is it just me or has the DNS resolver demo got major
> issues? like it wont compile. at all.
I would imagine that it is because it is an old demo from Indy v8 that has
not been updated for Indy v9. TIdDNSResolver was re-written in Indy 9.
> All I want is a simple example of how to use the iddnsresolver
> object to get the mx records (priority and host) for a given domain.
Simply assign the Host property to point to the DNS server that you want to
use, add qtMX to the QueryRecords property, pass the desired domain to the
Resolve() method, and then loop through the QueryResults collection looking
for TMXRecord instances. What is so complicated about that?
IdDNSResolver1.QueryRecords := [qtMX]; // or assign in the Object
IdDNSResolver1.Host := 'dns.someserver.com'; // or assign in the
for I = 0 to IdDNSResolver1.QueryResult.Count-1 do
if IdDNSResolver1.QueryResult[I] is TMXRecord then
with IdDNSResolver1.QueryResult[I] as TMXRecord do
ShowMessage('Host: ' + ExchangeServer + ', Priority: ' +
iddnsresolver demo/examples?? posted by Anthony on Thu, 30 Oct 2003