HOST_NOT_FOUND.
Any DNS record line in a zone file can be prefixed with "DELAY=" and
-a number of milliseconds (followed by whitespace).
+a number of milliseconds (followed by one space).
-Any DNS record line in a zone file can be prefixed with "DNSSEC" and
-at least one space; if all the records found by a lookup are marked
+Any DNS record line in a zone file can be prefixed with "DNSSEC ";
+if all the records found by a lookup are marked
as such then the response will have the "AD" bit set.
-Any DNS record line in a zone file can be prefixed with "AA" and
-at least one space; if all the records found by a lookup are marked
+Any DNS record line in a zone file can be prefixed with "AA "
+if all the records found by a lookup are marked
as such then the response will have the "AA" bit set.
*/
else if (Ustrncmp(p, US"DELAY=", 6) == 0) /* delay before response */
{
for (p += 6; *p >= '0' && *p <= '9'; p++) delay = delay*10 + *p - '0';
- while (isspace(*p)) p++;
+ if (isspace(*p)) p++;
}
else
break;
}
- if (!isspace(*p))
+ if (!isspace(*p)) /* new domain name */
{
uschar *pp = rrdomain;
uschar *PP = RRdomain;
pp[-1] = 0;
PP[-1] = 0;
}
- }
+ } /* else use previous line's domain name */
/* Compare domain names; first check for a wildcard */
{
}
+
+/*************************************************
+* Special-purpose domains *
+*************************************************/
+
+static int
+special_manyhome(uschar * packet, uschar * domain)
+{
+uschar *pk = packet + 12;
+uschar *rdlptr;
+int i, j;
+
+memset(packet, 0, 12);
+
+for (i = 104; i <= 111; i++) for (j = 0; j <= 255; j++)
+ {
+ pk = packname(domain, pk);
+ *pk++ = (ns_t_a >> 8) & 255;
+ *pk++ = (ns_t_a) & 255;
+ *pk++ = 0;
+ *pk++ = 1; /* class = IN */
+ pk += 4; /* TTL field; don't care */
+ rdlptr = pk; /* remember rdlength field */
+ pk += 2;
+
+ *pk++ = 10; *pk++ = 250; *pk++ = i; *pk++ = j;
+
+ rdlptr[0] = ((pk - rdlptr - 2) >> 8) & 255;
+ rdlptr[1] = (pk - rdlptr - 2) & 255;
+ }
+
+packet[6] = (2048 >> 8) & 255;
+packet[7] = 2048 & 255;
+packet[10] = 0;
+packet[11] = 0;
+
+(void)fwrite(packet, 1, pk - packet, stdout);
+return 0;
+}
+
+static int
+special_again(uschar * packet, uschar * domain)
+{
+int delay = atoi(CCS domain); /* digits at the start of the name */
+if (delay > 0) sleep(delay);
+return TRY_AGAIN;
+}
+
+
/*************************************************
* Entry point and main program *
*************************************************/
for (i = 0; i < domlen; i++) domain[i] = tolower(domain[i]);
if (Ustrcmp(domain, "manyhome.test.ex") == 0 && Ustrcmp(qtype, "A") == 0)
- {
- uschar *pk = packet + 12;
- uschar *rdlptr;
- int i, j;
-
- memset(packet, 0, 12);
-
- for (i = 104; i <= 111; i++) for (j = 0; j <= 255; j++)
- {
- pk = packname(domain, pk);
- *pk++ = (ns_t_a >> 8) & 255;
- *pk++ = (ns_t_a) & 255;
- *pk++ = 0;
- *pk++ = 1; /* class = IN */
- pk += 4; /* TTL field; don't care */
- rdlptr = pk; /* remember rdlength field */
- pk += 2;
-
- *pk++ = 10; *pk++ = 250; *pk++ = i; *pk++ = j;
-
- rdlptr[0] = ((pk - rdlptr - 2) >> 8) & 255;
- rdlptr[1] = (pk - rdlptr - 2) & 255;
- }
-
- packet[6] = (2048 >> 8) & 255;
- packet[7] = 2048 & 255;
- packet[10] = 0;
- packet[11] = 0;
-
- (void)fwrite(packet, 1, pk - packet, stdout);
- return 0;
- }
+ return special_manyhome(packet, domain);
+else if (domlen >= 14 && Ustrcmp(domain + domlen - 14, "test.again.dns") == 0)
+ return special_again(packet, domain);
+else if (domlen >= 13 && Ustrcmp(domain + domlen - 13, "test.fail.dns") == 0)
+ return NO_RECOVERY;
if (Ustrchr(domain, '.') == NULL && qualify != NULL &&