Package org.xbill.DNS

Examples of org.xbill.DNS.ARecord


      }

      ArrayList<MXRecord> list = new ArrayList<MXRecord>(records.length);
      for (int i=0;i<records.length;i++) {
        if ( records[i] instanceof ARecord ) {
          ARecord rec = (ARecord) records[i];
          MXRecord mx = new MXRecord(
            rec.getName(),
            rec.getDClass(),
            rec.getTTL(),
            100,
            rec.getName()
          );
          list.add(mx);
        } else {
          list.add((MXRecord)records[i]);
        }
View Full Code Here


    {
  m_rs = new RRset();
  m_name = Name.fromString("this.is.a.test.");
  m_name2 = Name.fromString("this.is.another.test.");
  m_ttl = 0xABCDL;
  m_a1 = new ARecord(m_name, DClass.IN, m_ttl,
         InetAddress.getByName("192.169.232.11"));
  m_a2 = new ARecord(m_name, DClass.IN, m_ttl+1,
         InetAddress.getByName("192.169.232.12"));

  m_s1 = new RRSIGRecord(m_name, DClass.IN, m_ttl, Type.A, 0xF, 0xABCDEL,
             new Date(), new Date(), 0xA, m_name,
             new byte[ 0 ]);
View Full Code Here

    public void test_addRR_invalidName() throws TextParseException, UnknownHostException
    {
  m_rs.addRR(m_a1);
 
  m_a2 = new ARecord(m_name2, DClass.IN, m_ttl,
         InetAddress.getByName("192.169.232.11"));
 
  try {
      m_rs.addRR(m_a2);
      fail("IllegalArgumentException not thrown");
View Full Code Here

    public void test_addRR_invalidDClass() throws TextParseException, UnknownHostException
    {
  m_rs.addRR(m_a1);
 
  m_a2 = new ARecord(m_name, DClass.CHAOS, m_ttl,
         InetAddress.getByName("192.169.232.11"));
 
  try {
      m_rs.addRR(m_a2);
      fail("IllegalArgumentException not thrown");
View Full Code Here

                        .withGroup("mygroup")
                        .withNameServerSetId("<my-nss-id>")
                        .withPlanId("<my-plan-id>")
                        .withResourceRecords(
                                Sets.newHashSet(
                                        (Record) new ARecord(Name.fromString("myzone.com."), DClass.IN, 3600,
                                                InetAddress.getByName("1.2.3.4"))))
                        .build();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
View Full Code Here

        Assert.assertEquals(1, replies.size());
        Assert.assertEquals(0, notified.size());

        Message result = replies.get(0);
        ARecord arec = (ARecord) result.getSectionArray(Section.ANSWER)[0];
        Assert.assertEquals("127.0.0.1", arec.getAddress().getHostAddress());
    }
View Full Code Here

        task.answer(TestUtils.getReplyRecord(), true);

        Message result = replies.get(0);
        Assert.assertTrue(result.getHeader().getFlag(Flags.AA));
        ARecord arec = (ARecord) result.getSectionArray(Section.ANSWER)[0];
        Assert.assertEquals("127.0.0.1", arec.getAddress().getHostAddress());
    }
View Full Code Here

                message.toWire(), message.toWire().length, InetAddress.getByName("127.0.0.2"), 0);
        return new UDPQuery(packet, sender);
    }

    public static Record getReplyRecord() throws TextParseException, UnknownHostException {
        return new ARecord(
                new Name("foo.example.com."),
                DClass.IN,
                1800,
                InetAddress.getByName("127.0.0.1"));
    }
View Full Code Here

        TestingConfiguration conf = new TestingConfiguration("bar", "example.com.", 12345);

        Protocol protocol = new BinaryBackendProtocol();
        Record result = protocol.decode(ipv4message, conf);
        ARecord rec = (ARecord) result;
        Assert.assertEquals("foo.example.com.", rec.getName().toString());
        Assert.assertEquals("192.168.0.1", rec.getAddress().getHostAddress());
        Assert.assertEquals(12345, rec.getTTL());
    }
View Full Code Here

                "\"moniker\": \"bar\" }";

        Protocol protocol = new JSONBackendProtocol();
        Record result = protocol.decode(update.getBytes(), conf);

        ARecord rec = (ARecord) result;
        Assert.assertEquals("foo.example.com.", rec.getName().toString());
        Assert.assertEquals("192.168.0.1", rec.getAddress().getHostAddress());
        Assert.assertEquals(12345, rec.getTTL());
    }
View Full Code Here

TOP

Related Classes of org.xbill.DNS.ARecord

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.