Package org.xbill.DNS

Examples of org.xbill.DNS.NSRecord


    Iterator<?> nsIterator = zone.getNS().rrs();

    while (nsIterator.hasNext()) {

      NSRecord record = (NSRecord) nsIterator.next();

      try {
        String nsIP = InetAddress.getByName(record.getTarget().toString()).getHostAddress();

        if (s.getInetAddress().getHostAddress().equals(nsIP)) {

          axfrAllowed = true;
          break;
        }

      } catch (UnknownHostException e) {

        log.warn("Unable to resolve hostname of nameserver " + record.getTarget() + " in zone " + zone.getOrigin() + " while processing AXFR request from " + s.getRemoteSocketAddress());
      }
    }

    if (!axfrAllowed) {
      log.warn("AXFR request of zone " + zone.getOrigin() + " from " + s.getRemoteSocketAddress() + " refused!");
View Full Code Here


            this.timeoutServers = new HashSet();
            List records = new LinkedList();

            records.add(new SOARecord(Name.root, DClass.IN, 3600, Name.root,
                    Name.root, 857623948, 0, 0, 0, 0));
            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;
View Full Code Here

            this.timeoutServers = new HashSet();
            List records = new LinkedList();

            records.add(new SOARecord(Name.root, DClass.IN, 3600, Name.root,
                    Name.root, 857623948, 0, 0, 0, 0));
            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;
View Full Code Here

      MXRecord mxrec = (MXRecord) rec;
      rmap.put("priority", mxrec.getPriority());
      rmap.put("target", mxrec.getTarget().toString());
    }
    else if (rec instanceof NSRecord) {
      NSRecord nsrec = (NSRecord) rec;
      rmap.put("target", nsrec.getTarget().toString());
    }
    else if (rec instanceof SRVRecord) {
      SRVRecord srv = (SRVRecord) rec;
      rmap.put("target", srv.getTarget().toString());
      rmap.put("port", srv.getPort());
View Full Code Here

            this.timeoutServers = new HashSet<Name>();
            List<Record> records = new LinkedList<Record>();

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

            Iterator<String> hosts = map.keySet().iterator();
            while (hosts.hasNext()) {
                String host = (String) hosts.next();
                Name hostname;
View Full Code Here

    Iterator<?> nsIterator = zone.getNS().rrs();

    while (nsIterator.hasNext()) {

      NSRecord record = (NSRecord) nsIterator.next();

      try {
        String nsIP = InetAddress.getByName(record.getTarget().toString()).getHostAddress();

        if (s.getInetAddress().getHostAddress().equals(nsIP)) {

          axfrAllowed = true;
          break;
        }

      } catch (UnknownHostException e) {

        log.warn("Unable to resolve hostname of nameserver " + record.getTarget() + " in zone " + zone.getOrigin() + " while processing AXFR request from " + s.getRemoteSocketAddress());
      }
    }

    if (!axfrAllowed) {
      log.warn("AXFR request of zone " + zone.getOrigin() + " from " + s.getRemoteSocketAddress() + " refused!");
View Full Code Here

  }

  @Override
  protected NSRecord createRecord(final Name name, final int dclass,
      final long ttl, final ObjectNode recordNode) {
    return new NSRecord(name, dclass, ttl, getNodeNameValue(recordNode,
        "target"));
  }
View Full Code Here

        FabricService service = fabricService.get();
        List<Record> records = new ArrayList<>();
        //TODO: At some point we need to manage the serial number.
        records.add(new SOARecord(domainRoot, DClass.IN, DAY, ns, admin, 1, refresh, retry, expire, minimumTtl));
        records.add(new NSRecord(domainRoot, DClass.IN, DAY, ns));
        return new Zone(domainRoot, records.toArray(new Record[records.size()]));
    }
View Full Code Here

            this.timeoutServers = new HashSet();
            List records = new LinkedList();

            records.add(new SOARecord(Name.root, DClass.IN, 3600, Name.root,
                    Name.root, 857623948, 0, 0, 0, 0));
            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;
View Full Code Here

    //TODO file bug upstream that queryResult may never be null
    int length = queryResult == null ? 0 : queryResult.length;
    for (int j = 0; j < length; j++) {
      final Record record = queryResult[j];
      if(record instanceof NSRecord) {
        final NSRecord nsRecord = (NSRecord) record;
        final Name target = nsRecord.getTarget();
        result.add(new SRVRecord(name, DClass.IN, nsRecord.getTTL(), 0, 0, SimpleResolver.DEFAULT_PORT, target));
      }
    }
   
    //query for primary ns in SOA record (may overwrite/be equal to one of the ns records)
    query = new Lookup(zone, Type.SOA);
View Full Code Here

TOP

Related Classes of org.xbill.DNS.NSRecord

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.