[Pdns-users] SQL backend type question - wildcard matching

Laurence Brockman laurence.brockman at sjrb.ca
Tue Oct 11 19:44:02 UTC 2005


Hey guys,

 

I thought this might be a good place to post a quick question...

 

How does PDNS check a DNS request against a wildcard entry in the gmysql
backend? We have a case where we need to determine if a particular entry
exists in the database (Which is easy with a non-wildcard entry) but we also
need an efficient way of matching that against a wildcard entry. What SQL
query do you guys use? I looked at the source code and found 

 

select content,ttl,prio,type,domain_id,name from records where name like
'%s'

 

But I'm wondering what the value of %s would be?

 

Example:

 

We have *.one.two.three.domain.com in our DB and we need to test if
123.123.123.one.two.three.domain.com is an entry in the table. Now, I know
we could check to see if *.123.123.123.one.two.three.domain.com and
*.123.123.one.two.three.domain.com and *.123.one.two.three.domain.com,
etc... but I was hoping there was a more efficient way of checking this that
you guys have already come up with?

 

Thanks,

Laurence

 

Laurence Brockman

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.powerdns.com/pipermail/pdns-users/attachments/20051011/54a1715e/attachment.html>


More information about the Pdns-users mailing list