Package org.xbill.DNS

Examples of org.xbill.DNS.Name


  // primaryZoneMap.put(zname, newzone);
  // }

  @SuppressWarnings("unused")
  private void addTSIG(String algstr, String namestr, String key) throws IOException {
    Name name = Name.fromString(namestr, Name.root);
    TSIGs.put(name, new TSIG(algstr, namestr, key));
  }
View Full Code Here


    int labels = name.labels();

    for (int i = 1; i < labels; i++) {

      Name tname = new Name(name, i);
      foundzone = getZone(tname);

      if (foundzone != null) {
        return foundzone;
      }
View Full Code Here

  }

  private void addAdditional2(Message response, int section, int flags) {
    Record[] records = response.getSectionArray(section);
    for (Record r : records) {
      Name glueName = r.getAdditionalName();
      if (glueName != null) {
        addGlue(response, glueName, flags);
      }
    }
  }
View Full Code Here

        rcode = addAnswer(response, cname.getTarget(), type, dclass, iterations + 1, flags);
      } else if (sr.isDNAME()) {
        DNAMERecord dname = sr.getDNAME();
        RRset rrset = new RRset(dname);
        addRRset(name, response, rrset, Section.ANSWER, flags);
        Name newname;
        try {
          newname = name.fromDNAME(dname);
        } catch (NameTooLongException e) {
          return Rcode.YXDOMAIN;
        }
View Full Code Here

    if (query.getHeader().getFlag(Flags.RD)) {
      response.getHeader().setFlag(Flags.RD);
    }
    response.addRecord(queryRecord, Section.QUESTION);

    Name name = queryRecord.getName();
    int type = queryRecord.getType();
    int dclass = queryRecord.getDClass();
    if (type == Type.AXFR && socket != null) {
      return doAXFR(name, query, tsig, queryTSIG, socket);
    }
View Full Code Here

    return XMLGenerator.toXML(this, doc);
  }

  public Zone toZone() throws IOException{

    Name zoneName = Name.fromString(name);
    Name primaryNS = Name.fromString(this.primaryDNS);

    SOARecord soaRecord = new SOARecord(zoneName, DClass.value(dclass), ttl, primaryNS, Name.fromString(this.adminEmail), serial, refresh, retry, expire, minimum);

    //Record primaryNSRecord = Record.newRecord(primaryNS, Type.NS, DClass.value(dclass), ttl);
View Full Code Here

      if(!zoneFile.canRead()){
        log.error("FileZoneProvider " + name + " unable to access zone file " + zoneFile );
        continue;
      }

      Name origin;
      try {

        origin = Name.fromString(zoneFile.getName(), Name.root);
        Zone zone = new Zone(origin, zoneFile.getPath());
View Full Code Here

            records.add(new NSRecord(Name.root, DClass.IN, 3600, Name.root));

            Iterator hosts = zonedata.keySet().iterator();
            while (hosts.hasNext()) {
                String host = (String) hosts.next();
                Name hostname;
                if (!host.endsWith(".")) {
                    hostname = Name.fromString(host + ".");
                } else {
                    hostname = Name.fromString(host);
                }
View Full Code Here

    private void addAdditional2(Message response, int section, int flags) {
        Record[] records = response.getSectionArray(section);
        for (int i = 0; i < records.length; i++) {
            Record r = records[i];
            Name glueName = r.getAdditionalName();
            if (glueName != null)
                addGlue(response, glueName, flags);
        }
    }
View Full Code Here

                    iterations + 1, flags);
        } else if (sr.isDNAME()) {
            DNAMERecord dname = sr.getDNAME();
            RRset rrset = new RRset(dname);
            addRRset(name, response, rrset, Section.ANSWER, flags);
            Name newname;
            try {
                newname = name.fromDNAME(dname);
            } catch (NameTooLongException e) {
                return Rcode.YXDOMAIN;
            }
View Full Code Here

TOP

Related Classes of org.xbill.DNS.Name

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.