feat(fls): DNS records from /dns/hosts, as Java's server answers them
Java's DNS server reads its records from the text file /dns/hosts on every query. dnsHosts.ts ports that reading (DNSServer.leseRecordListe, ResourceRecord, Dateisystem.holeDatei) and keeps in the model the records Java answers: type exactly A, MX or NS, and a name Java accepted. The file stays in the file system as it is. Both oracles read 76 hand-picked hosts files (dns-hosts.cases.txt): the Java oracle through DNSServer.holeResourceRecords (DnsHostsCases), the Swift oracle through TopologyDNSHostsFileCodec (--dns-hosts). The Java view matches Java on every case; the model matches Swift except for 33 named cases in twelve reasons: Java splits at single spaces and LF only, has no comments or "IN", turns a TTL that is no int into 3600, keeps duplicates, and empties names with a leading digit. The Swift dump now carries each server's records; the corpus comparison covers them on 16 files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -180,10 +180,25 @@ export interface GnutellaConfiguration {
|
||||
readonly maximumKnownPeers: number;
|
||||
}
|
||||
|
||||
/** The DNS records follow with the hosts file (Java's /dns/hosts). */
|
||||
export type DnsRecordType = 'A' | 'MX' | 'NS';
|
||||
|
||||
/**
|
||||
* One record a DNS server answers with (Swift's TopologyDNSResourceRecord):
|
||||
* `name` in lower case without the final dot (the root is "."), `target` an
|
||||
* IPv4 address for A, an absolute name ("mail.filius.de.") for MX and NS.
|
||||
*/
|
||||
export interface DnsResourceRecord {
|
||||
readonly name: string;
|
||||
readonly type: DnsRecordType;
|
||||
readonly ttlSeconds: number;
|
||||
readonly target: string;
|
||||
}
|
||||
|
||||
export interface DnsServerConfiguration {
|
||||
readonly recursiveResolutionEnabled: boolean;
|
||||
readonly forwardingServerIPAddress?: string;
|
||||
/** In the order of Java's /dns/hosts, which stays in the file system as it is. */
|
||||
readonly records: readonly DnsResourceRecord[];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user