Skip to content

Commit

Permalink
Add support to FakeDNSServer to resolve with DNAME record
Browse files Browse the repository at this point in the history
  • Loading branch information
mnylen authored and vietj committed Nov 6, 2023
1 parent a4126d7 commit f32d88b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/test/java/io/vertx/test/fakedns/FakeDNSServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,24 @@ public Set<ResourceRecord> getRecords(QuestionRecord questionRecord) throws org.
});
}

public FakeDNSServer testResolveDNAME(final String dname) {
return store(new RecordStore() {
@Override
public Set<ResourceRecord> getRecords(QuestionRecord questionRecord) throws org.apache.directory.server.dns.DnsException {
Set<ResourceRecord> set = new HashSet<>();

ResourceRecordModifier rm = new ResourceRecordModifier();
rm.setDnsClass(RecordClass.IN);
rm.setDnsName("dns.vertx.io");
rm.setDnsTtl(100);
rm.setDnsType(RecordType.DNAME);
rm.put(DnsAttribute.DOMAIN_NAME, dname);
set.add(rm.getEntry());
return set;
}
});
}

public FakeDNSServer testLookup4(final String ip) {
return store(new RecordStore() {
@Override
Expand Down

0 comments on commit f32d88b

Please sign in to comment.