Discussion:
[Unbound-users] Distinguishing client queries vs. internal sub-queries
Tomas Hozza
2015-03-20 15:42:59 UTC
Permalink
Hello.

I'm interested if there is any way to distinguish,
from unbound module point of view, if a query that
is being passed to the module was generated by some
client or generated internally by some other module?

From what I know, there is no combination of module
ext_state and event, that would identify such situation.

The reason I need this is that I would like to create
a module that acts ONLY on queries from clients and
FINAL responses to such queries.

Imagine my module is not the first in the list of modules.
New query from client will invoke the module with mod_state_initial
and mod_event_pass. If then e.g. validator created a new
subquery for e.g. ". DNSKEY IN", the query will be in the
end also passed to my module with mod_state_initial and
mod_event_pass. However my module don't care about such query.

So is there any way in a module to distinguish queries from clients
from internally generated sub-queries? If not would it be possible
to add such mechanism?

Thank you.

Regards,
--
Tomas Hozza
Software Engineer - EMEA ENG Developer Experience

PGP: 1D9F3C2D
Red Hat Inc. http://cz.redhat.com
Stephane LAPIE
2015-03-21 01:44:53 UTC
Permalink
Hello,

I happen to need about the same kind of processing :
ignore all sub queries and only care about ones emitted by a client,
and about responses to a client.

From my own experience,
the simplest way to tell them apart from inside a module,
is that a sub query will not have a client IP address.

Cheers,
Post by Tomas Hozza
Hello.
I'm interested if there is any way to distinguish,
from unbound module point of view, if a query that
is being passed to the module was generated by some
client or generated internally by some other module?
From what I know, there is no combination of module
ext_state and event, that would identify such situation.
The reason I need this is that I would like to create
a module that acts ONLY on queries from clients and
FINAL responses to such queries.
Imagine my module is not the first in the list of modules.
New query from client will invoke the module with mod_state_initial
and mod_event_pass. If then e.g. validator created a new
subquery for e.g. ". DNSKEY IN", the query will be in the
end also passed to my module with mod_state_initial and
mod_event_pass. However my module don't care about such query.
So is there any way in a module to distinguish queries from clients
from internally generated sub-queries? If not would it be possible
to add such mechanism?
Thank you.
Regards,
--
Stephane LAPIE, EPITA SRS, Promo 2005
"Even when they have digital readouts, I can't understand them."
--MegaTokyo
Tomas Hozza
2015-03-24 09:45:41 UTC
Permalink
Post by Stephane LAPIE
Hello,
ignore all sub queries and only care about ones emitted by a client,
and about responses to a client.
From my own experience,
the simplest way to tell them apart from inside a module,
is that a sub query will not have a client IP address.
Cheers,
Post by Tomas Hozza
Hello.
I'm interested if there is any way to distinguish,
from unbound module point of view, if a query that
is being passed to the module was generated by some
client or generated internally by some other module?
From what I know, there is no combination of module
ext_state and event, that would identify such situation.
The reason I need this is that I would like to create
a module that acts ONLY on queries from clients and
FINAL responses to such queries.
Imagine my module is not the first in the list of modules.
New query from client will invoke the module with mod_state_initial
and mod_event_pass. If then e.g. validator created a new
subquery for e.g. ". DNSKEY IN", the query will be in the
end also passed to my module with mod_state_initial and
mod_event_pass. However my module don't care about such query.
So is there any way in a module to distinguish queries from clients
from internally generated sub-queries? If not would it be possible
to add such mechanism?
Thank you.
Regards,
--
Stephane LAPIE, EPITA SRS, Promo 2005
"Even when they have digital readouts, I can't understand them."
--MegaTokyo
Thank you for the clue.

It works well.

Regards,
--
Tomas Hozza
Software Engineer - EMEA ENG Developer Experience

PGP: 1D9F3C2D
Red Hat Inc. http://cz.redhat.com
Continue reading on narkive:
Loading...