Discussion:
[Dnsmasq-discuss] [patch] Option to remove A-forA
Mattias Hellström
2018-01-25 15:03:57 UTC
Permalink
Hi,
I have made a patch to disable the A-for-A feature.
I believe that the text portions can be made better by an actual DNS expert.

Given the following quote, and if that trend holds true, there are probably
no significant A-for-A requests anymore.

The percentages of A-for-A seen by root servers reported in 2001, 2003, and
2008 was 12%–18%, 7.03%, and 2.7%, respectively. The decreasing trend
continues in our data collected in 2012, where A-for-A only contributes
0.4% of the traffic.

[[ http://cs.northwestern.edu/~ychen/Papers/DNS_ToN15.pdf ]]


---

man/dnsmasq.8 | 3 +++

src/dnsmasq.h | 3 ++-

src/option.c | 3 +++

src/rfc1035.c | 2 +-

4 files changed, 9 insertions(+), 2 deletions(-)


diff --git a/man/dnsmasq.8 b/man/dnsmasq.8

index 6b914ec..40d531c 100644

--- a/man/dnsmasq.8

+++ b/man/dnsmasq.8

@@ -1908,6 +1908,9 @@ A special case of

which differs in two respects. Firstly, only --server and --rev-server are
allowed

in the configuration file included. Secondly, the file is re-read and the
configuration

therein is updated when dnsmasq receives SIGHUP.

+.TP

+.B --no-afora

+Do not treat A-for-A DNS requests special. I.e. do not duck type a FQDN to
an IP.

.SH CONFIG FILE

At startup, dnsmasq reads

.I /etc/dnsmasq.conf,

diff --git a/src/dnsmasq.h b/src/dnsmasq.h

index f4d330a..dbb3477 100644

--- a/src/dnsmasq.h

+++ b/src/dnsmasq.h

@@ -250,7 +250,8 @@ struct event_desc {

#define OPT_MAC_B64 54

#define OPT_MAC_HEX 55

#define OPT_TFTP_APREF_MAC 56

-#define OPT_LAST 57

+#define OPT_NO_AFORA 57

+#define OPT_LAST 58


/* extra flags for my_syslog, we use a couple of facilities since they are
known

not to occupy the same bits as priorities, no matter how syslog.h is
set up. */

diff --git a/src/option.c b/src/option.c

index 831593b..be3bb9e 100644

--- a/src/option.c

+++ b/src/option.c

@@ -160,6 +160,7 @@ struct myoption {

#define LOPT_DHCPTTL 348

#define LOPT_TFTP_MTU 349

#define LOPT_REPLY_DELAY 350

+#define LOPT_NO_AFORA 351


#ifdef HAVE_GETOPT_LONG

static const struct option opts[] =

@@ -325,6 +326,7 @@ static const struct myoption opts[] =

{ "script-arp", 0, 0, LOPT_SCRIPT_ARP },

{ "dhcp-ttl", 1, 0 , LOPT_DHCPTTL },

{ "dhcp-reply-delay", 1, 0, LOPT_REPLY_DELAY },

+ { "no-afora", 0, 0, LOPT_NO_AFORA },

{ NULL, 0, 0, 0 }

};


@@ -497,6 +499,7 @@ static struct {

{ LOPT_IGNORE_ADDR, ARG_DUP, "<ipaddr>", gettext_noop("Ignore DNS
responses containing ipaddr."), NULL },

{ LOPT_DHCPTTL, ARG_ONE, "<ttl>", gettext_noop("Set TTL in DNS responses
with DHCP-derived addresses."), NULL },

{ LOPT_REPLY_DELAY, ARG_ONE, "<integer>", gettext_noop("Delay DHCP
replies for at least number of seconds."), NULL },

+ { LOPT_NO_AFORA, OPT_NO_AFORA, NULL, gettext_noop("Do not treat A-for-A
special."), NULL },

{ 0, 0, NULL, NULL, NULL }

};


diff --git a/src/rfc1035.c b/src/rfc1035.c

index 0ad3ab1..940fc25 100644

--- a/src/rfc1035.c

+++ b/src/rfc1035.c

@@ -1570,7 +1570,7 @@ size_t answer_request(struct dns_header *header, char
*limit, size_t qlen,


/* Check for "A for A" queries; be rather conservative

about what looks like dotted-quad. */

- if (qtype == T_A)

+ if (qtype == T_A && !option_bool(OPT_NO_AFORA))

{

char *cp;

unsigned int i, a;
Geert Stappers
2018-01-25 20:31:30 UTC
Permalink
Post by Mattias Hellström
Hi,
I have made a patch to disable the A-for-A feature.
I believe that the text portions can be made better by an actual DNS expert.
Given the following quote, and if that trend holds true, there are probably
no significant A-for-A requests anymore.
The percentages of A-for-A seen by root servers reported in 2001, 2003, and
2008 was 12%???18%, 7.03%, and 2.7%, respectively. The decreasing trend
} 2008 was 12%, 7.03%, and 2.7%, respectively. The decreasing trend
Post by Mattias Hellström
continues in our data collected in 2012, where A-for-A only contributes
0.4% of the traffic.
[[ http://cs.northwestern.edu/~ychen/Papers/DNS_ToN15.pdf ]]
---
man/dnsmasq.8 | 3 +++
src/dnsmasq.h | 3 ++-
src/option.c | 3 +++
src/rfc1035.c | 2 +-
4 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/man/dnsmasq.8 b/man/dnsmasq.8
index 6b914ec..40d531c 100644
--- a/man/dnsmasq.8
+++ b/man/dnsmasq.8
FWIW
after "unmengle what was mengled by email programm" still patch errors occure.


Find attached the unmengled patch, it will yield this

patching file man/dnsmasq.8
Hunk #1 succeeded at 1908 with fuzz 1.
patching file src/dnsmasq.h
Hunk #1 FAILED at 250.
1 out of 1 hunk FAILED -- saving rejects to file src/dnsmasq.h.rej
patching file src/option.c
Hunk #1 FAILED at 160.
Hunk #3 succeeded at 498 with fuzz 2.
1 out of 3 hunks FAILED -- saving rejects to file src/option.c.rej
patching file src/rfc1035.c
Hunk #1 FAILED at 1570.
1 out of 1 hunk FAILED -- saving rejects to file src/rfc1035.c.rej


against git HEAD



Groeten
Geert Stappers
--
Leven en laten leven
Mattias Hellström
2018-01-26 08:03:07 UTC
Permalink
Looks like I invoked a whitespace problem in the copy paste. Here is the
patch as attachment.
The relevant parts are equal to the unmengled if I test with "diff -bB"
Post by Mattias Hellström
Post by Mattias Hellström
Hi,
I have made a patch to disable the A-for-A feature.
I believe that the text portions can be made better by an actual DNS
expert.
Post by Mattias Hellström
Given the following quote, and if that trend holds true, there are
probably
Post by Mattias Hellström
no significant A-for-A requests anymore.
The percentages of A-for-A seen by root servers reported in 2001, 2003,
and
Post by Mattias Hellström
2008 was 12%???18%, 7.03%, and 2.7%, respectively. The decreasing trend
} 2008 was 12%, 7.03%, and 2.7%, respectively. The decreasing trend
Post by Mattias Hellström
continues in our data collected in 2012, where A-for-A only contributes
0.4% of the traffic.
[[ http://cs.northwestern.edu/~ychen/Papers/DNS_ToN15.pdf ]]
---
man/dnsmasq.8 | 3 +++
src/dnsmasq.h | 3 ++-
src/option.c | 3 +++
src/rfc1035.c | 2 +-
4 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/man/dnsmasq.8 b/man/dnsmasq.8
index 6b914ec..40d531c 100644
--- a/man/dnsmasq.8
+++ b/man/dnsmasq.8
FWIW
after "unmengle what was mengled by email programm" still patch errors occure.
Find attached the unmengled patch, it will yield this
patching file man/dnsmasq.8
Hunk #1 succeeded at 1908 with fuzz 1.
patching file src/dnsmasq.h
Hunk #1 FAILED at 250.
1 out of 1 hunk FAILED -- saving rejects to file src/dnsmasq.h.rej
patching file src/option.c
Hunk #1 FAILED at 160.
Hunk #3 succeeded at 498 with fuzz 2.
1 out of 3 hunks FAILED -- saving rejects to file src/option.c.rej
patching file src/rfc1035.c
Hunk #1 FAILED at 1570.
1 out of 1 hunk FAILED -- saving rejects to file src/rfc1035.c.rej
against git HEAD
Groeten
Geert Stappers
--
Leven en laten leven
Geert Stappers
2018-01-26 08:38:34 UTC
Permalink
Post by Mattias Hellström
Post by Geert Stappers
Post by Mattias Hellström
Hi,
I have made a patch to disable the A-for-A feature.
I believe that the text portions can be made better by an actual DNS expert.
FWIW
after "unmengle what was mengled by email programm" still patch errors occure.
Looks like I invoked a whitespace problem in the copy paste. Here is the
patch as attachment.
The relevant parts are equal to the unmengled if I test with "diff -bB"
Yes, that patch applies cleanly.

I propose this commit message:

-----8<----8<-------8<----
Option to remove A-forA

Given the following quote, and if that trend holds true, there are probably
no significant A-for-A requests anymore.

The percentages of A-for-A seen by root servers reported in 2001, 2003, and
2008 was 12%, 7.03%, and 2.7%, respectively. The decreasing trend
continues in our data collected in 2012, where A-for-A only contributes
0.4% of the traffic.

[[ http://cs.northwestern.edu/~ychen/Papers/DNS_ToN15.pdf ]]

Signed-of-by: Mattias Hellstrom <***@gmail.com>
-----8<----8<-------8<----
Post by Mattias Hellström
Post by Geert Stappers
Post by Mattias Hellström
I have made a patch to disable the A-for-A feature.
I believe that the text portions can be made better by an actual DNS expert.
+++ b/man/dnsmasq.8
+.TP
+.B --no-afora
+Do not treat A-for-A DNS requests special. I.e. do not duck type a FQDN to an IP.
+++ b/src/option.c
+ { LOPT_NO_AFORA, OPT_NO_AFORA, NULL, gettext_noop("Do not treat A-for-A special."), NULL },


Those text portions??



Groeten
Geert Stappers
--
Leven en laten leven
Mattias Hellström
2018-01-26 12:30:18 UTC
Permalink
+++ b/man/dnsmasq.8
+.TP
+.B --no-afora
+Do not treat A-for-A DNS requests special. I.e. do not duck type a FQDN to
an IP.
+++ b/src/option.c
+ { LOPT_NO_AFORA, OPT_NO_AFORA, NULL, gettext_noop("Do not treat A-for-A
special."), NULL },
Post by Geert Stappers
Those text portions??
Yes those, I am not super happy about them, but I know a domain specialist
will have the right wording at their fingertips.
Post by Geert Stappers
Post by Mattias Hellström
Post by Geert Stappers
Post by Mattias Hellström
Hi,
I have made a patch to disable the A-for-A feature.
I believe that the text portions can be made better by an actual DNS
expert.
Post by Mattias Hellström
Post by Geert Stappers
FWIW
after "unmengle what was mengled by email programm" still patch
errors occure.
Post by Mattias Hellström
Looks like I invoked a whitespace problem in the copy paste. Here is the
patch as attachment.
The relevant parts are equal to the unmengled if I test with "diff -bB"
Yes, that patch applies cleanly.
-----8<----8<-------8<----
Option to remove A-forA
Given the following quote, and if that trend holds true, there are probably
no significant A-for-A requests anymore.
The percentages of A-for-A seen by root servers reported in 2001, 2003, and
2008 was 12%, 7.03%, and 2.7%, respectively. The decreasing trend
continues in our data collected in 2012, where A-for-A only contributes
0.4% of the traffic.
[[ http://cs.northwestern.edu/~ychen/Papers/DNS_ToN15.pdf ]]
-----8<----8<-------8<----
Post by Mattias Hellström
Post by Geert Stappers
Post by Mattias Hellström
I have made a patch to disable the A-for-A feature.
I believe that the text portions can be made better by an actual DNS
expert.
+++ b/man/dnsmasq.8
+.TP
+.B --no-afora
+Do not treat A-for-A DNS requests special. I.e. do not duck type a FQDN to an IP.
+++ b/src/option.c
+ { LOPT_NO_AFORA, OPT_NO_AFORA, NULL, gettext_noop("Do not treat A-for-A
special."), NULL },
Those text portions??
Groeten
Geert Stappers
--
Leven en laten leven
_______________________________________________
Dnsmasq-discuss mailing list
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Simon Kelley
2018-01-26 14:42:50 UTC
Permalink
Hi,
I have made a patch to disable the A-for-A feature. 
I believe that the text portions can be made better by an actual DNS expert.
Given the following quote, and if that trend holds true, there are
probably no significant A-for-A requests anymore.
The percentages of A-for-A seen by root servers reported in 2001, 2003,
and 2008 was 12%–18%, 7.03%, and 2.7%, respectively. The decreasing
trend continues in our data collected in 2012, where A-for-A only
contributes 0.4% of the traffic.
[[ http://cs.northwestern.edu/~ychen/Papers/DNS_ToN15.pdf ]]
How likely is it that this new option will ever be used? Can we even
provide guidance on when it should be set or not set?

My guess is that it will almost never be used, so the extra code for
this will occupy memory in millions of devices for no benefit, and it
will be some small extra support effort forever.

There are no downsides to doing A-for-A, as far as I know. If this
feature is still doing some good, it should be left. If it's obsolete,
it should be entirely removed, that way we gain a small codesize and
support reduction, instead of increasing both.

IMHO

Cheers,

Simon.
Mattias Hellström
2018-01-26 18:17:31 UTC
Permalink
Post by Mattias Hellström
Post by Mattias Hellström
Hi,
I have made a patch to disable the A-for-A feature.
I believe that the text portions can be made better by an actual DNS
expert.
There are no downsides to doing A-for-A, as far as I know. If this
feature is still doing some good, it should be left. If it's obsolete,
it should be entirely removed, that way we gain a small codesize and
support reduction, instead of increasing both.
In that case, removing it completely is the best choice in my opinion.
The source of these requests was patched out man many years ago.
And any new sources probably want a proper NXDOMAIN in return.
Simon Kelley
2018-02-14 22:57:22 UTC
Permalink
Post by Simon Kelley
Hi,
I have made a patch to disable the A-for-A feature. 
I believe that the text portions can be made better by an actual DNS expert.
There are no downsides to doing A-for-A, as far as I know. If this
feature is still doing some good, it should be left. If it's obsolete,
it should be entirely removed, that way we gain a small codesize and
support reduction, instead of increasing both.
 
In that case, removing it completely is the best choice in my opinion.
The source of these requests was patched out man many years ago. 
And any new sources probably want a proper NXDOMAIN in return.
I agree. Fix committed.

Cheers,

Simon.

Loading...