Package org.xbill.DNS

Examples of org.xbill.DNS.Zone


                                    "getRecord found an unexpected data");
                        }
                    }
            }

            zone = new Zone(Name.root, (Record[]) records
                    .toArray(new Record[] {}));
           
        } catch (TextParseException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
View Full Code Here


     *
     * @param args
     * @throws Exception
     */
    public void testINARecords() throws Exception {
        Zone z = new Zone(Name.fromString("pippo.com."),getClass().getResource("pippo-com.zone").getFile());
        dnsServer.setResolver(null);
        dnsServer.setLookupper(new ZoneLookupper(z));
        Collection records = dnsServer.findMXRecords("www.pippo.com.");
        assertEquals(1, records.size());
        assertEquals("pippo.com.inbound.mxlogic.net.", records.iterator()
View Full Code Here

    /**
     * @throws Exception
     */
    public void testMXCatches() throws Exception {
        Zone z = new Zone(Name.fromString("test-zone.com."),getClass().getResource("test-zone-com.zone").getFile());
        dnsServer.setResolver(null);
        dnsServer.setLookupper(new ZoneLookupper(z));
        Collection res = dnsServer.findMXRecords("test-zone.com.");
        try {
            res.add(new Object());
View Full Code Here

     *
     * @param args
     * @throws Exception
     */
    public void testCNAMEasMXrecords() throws Exception {
        Zone z = new Zone(Name.fromString("brandilyncollins.com."),getClass().getResource("brandilyncollins-com.zone").getFile());
        dnsServer.setResolver(null);
        dnsServer.setLookupper(new ZoneLookupper(z));
        Iterator records = dnsServer.getSMTPHostAddresses("brandilyncollins.com.");
        assertEquals(true, records.hasNext());
    }
View Full Code Here

     *
     * @param args
     * @throws Exception
     */
    public void testINARecords() throws Exception {
        Zone z = new Zone(Name.fromString("pippo.com."),getClass().getResource("pippo-com.zone").getFile());
        dnsServer.setResolver(null);
        dnsServer.setLookupper(new ZoneLookupper(z));
        Collection records = dnsServer.findMXRecords("www.pippo.com.");
        assertEquals(1, records.size());
        assertEquals("pippo.com.inbound.mxlogic.net.", records.iterator()
View Full Code Here

    /**
     * @throws Exception
     */
    public void testMXCatches() throws Exception {
        Zone z = new Zone(Name.fromString("test-zone.com."),getClass().getResource("test-zone-com.zone").getFile());
        dnsServer.setResolver(null);
        dnsServer.setLookupper(new ZoneLookupper(z));
        Collection res = dnsServer.findMXRecords("test-zone.com.");
        try {
            res.add(new Object());
View Full Code Here

     *
     * @param args
     * @throws Exception
     */
    public void testCNAMEasMXrecords() throws Exception {
        Zone z = new Zone(Name.fromString("brandilyncollins.com."),getClass().getResource("brandilyncollins-com.zone").getFile());
        dnsServer.setResolver(null);
        dnsServer.setLookupper(new ZoneLookupper(z));
        Iterator records = dnsServer.getSMTPHostAddresses("brandilyncollins.com.");
        assertEquals(true, records.hasNext());
    }
View Full Code Here

        log.warn("Unable to transfer zone " + this.secondaryZone.getZoneName() + " from server " + this.secondaryZone.getRemoteServerAddress() + ", response is not a valid AXFR!");

        return;
      }

      Zone axfrZone = new Zone(this.secondaryZone.getZoneName(),records.toArray(new Record[records.size()]));

      log.debug("Zone " + this.secondaryZone.getZoneName() + " successfully transfered from server " + this.secondaryZone.getRemoteServerAddress());

      if(!axfrZone.getSOA().getName().equals(this.secondaryZone.getZoneName())){

        log.warn("Invalid AXFR zone name in response when updating secondary zone " + this.secondaryZone.getZoneName() + ". Got zone name " + axfrZone.getSOA().getName() + " in respons.");
      }

      if(this.secondaryZone.getZoneCopy() == null || this.secondaryZone.getZoneCopy().getSOA().getSerial() != axfrZone.getSOA().getSerial()){

        this.secondaryZone.setZoneCopy(axfrZone);
        this.secondaryZone.setDownloaded(new Timestamp(System.currentTimeMillis()));
        this.zoneProvider.zoneUpdated(this.secondaryZone);

        log.info("Zone " + this.secondaryZone.getZoneName() + " successfully updated from server " + this.secondaryZone.getRemoteServerAddress());
      }else{

        log.info("Zone " + this.secondaryZone.getZoneName() + " is already up to date with serial " + axfrZone.getSOA().getSerial());
        this.zoneProvider.zoneChecked(secondaryZone);
      }

    } catch (IOException e) {
View Full Code Here

    TSIGs.put(name, new TSIG(algstr, namestr, key));
  }

  private Zone findBestZone(Name name) {

    Zone foundzone = getZone(name);

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

    return null;
  }

  private RRset findExactMatch(Name name, int type, int dclass, boolean glue) {
    Zone zone = findBestZone(name);

    if (zone != null) {
      return zone.findExactMatch(name, type);
    }

    return null;
  }
View Full Code Here

TOP

Related Classes of org.xbill.DNS.Zone

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.