/** * Creates a DNS A type record. * @param name The record name. Generally a fully qualified domain name such as host.example.com. * @param ttl The time to live in seconds. * @param ip The ip4 address that the name will resolve. * @return A DNSRecord representing an A type record. * @throws ConfigurationStoreException */ public static DNSRecord createARecord(String name, long ttl, String ip) throws DNSRecordCreationException { if (!name.endsWith(".")) name = name + "."; try { ARecord rec = new ARecord(Name.fromString(name), DClass.IN, ttl, InetAddress.getByName(ip)); return fromWire(rec.toWireCanonical()); } catch (Exception e) { throw new DNSRecordCreationException("Failed to create DNS A record: " + e.getMessage(), e); } }
5 /*public key alg, RFC 4034*/, cert.getEncoded()); return fromWire(rec.toWireCanonical());
/** * Creates a DNS MX record. * @param name The email domain or host used to determine where email should be sent to. * @param target The host server that email should be sent to. * @param ttl The time to live in seconds. * @param priority The priority of the target host. Lower priorities are preferred. * @return A DNSRecord representing an MX type record. * @throws ConfigurationStoreException */ public static DNSRecord createMXRecord(String name, String target, long ttl, int priority) throws DNSRecordCreationException { if (!name.endsWith(".")) name = name + "."; if (!target.endsWith(".")) target = target + "."; try { MXRecord rec = new MXRecord(Name.fromString(name), DClass.IN, ttl, priority, Name.fromString(target)); return fromWire(rec.toWireCanonical()); } catch (Exception e) { throw new DNSRecordCreationException("Failed to create DNS MX record: " + e.getMessage(), e); } }
return fromWire(rec.toWireCanonical());
Name.fromString(hostMaster), serial, refresh, retry, expire, minumum); return fromWire(rec.toWireCanonical());