On Mon Feb 13 11:11:02 2017, CURTIS wrote:
Show quoted text> Hi,
>
> I noticed there is now a IETF standard for this edns option:
>
https://datatracker.ietf.org/doc/rfc7871/
>
> Could we reopen this ticket? I too would like Net::DNS::Resolver to
> have edns-subnet-address support.
RFC7871 is NOT a standard, its status is currently informational.
If you are intending to use Net::DNS::Nameserver, then you will need to provide a suitable reply handler.
The problem (RT#115558) which previously prevented the creation of EDNS replies was fixed in 1.07.
Whatever you do, please use _only_ the advertised methods.
Finding out what option numbers are present:
my @options = $query->edns->options;
The option value can be obtained from the query passed to your reply handler like this:
my $value = $query->edns->option('CLIENT-SUBNET'); # also accepts number
Net::DNS knows nothing about EDNS options other than the (name,value) pair.
Decoding is expected to be done by the end user.
Setting options in the reply is more of a challenge, because the reply handler has no means of accessing the reply packet.
At the risk of making the interface to the reply handler even more inefficient and ugly than it already is, the simplest solution would be something similar to the headermask.
my $optionmask = {
'CLIENT-SUBNET' => $content
};
Please keep in mind that Net::DNS::Nameserver will never be anything more than an experimental plaything and the security of your machine will be at risk if exposed to the internet.