Package org.xbill.DNS

Examples of org.xbill.DNS.ARecord


                                        }
                                    }
                                } else {
                                    Object value = hm.get(type);
                                    if ("A".equals(type)) {
                                        records.add(new ARecord(hostname,
                                                DClass.IN, 3600, Address
                                                        .getByAddress((String) value)));
                                    } else if ("AAAA".equals(type)) {
                                        records.add(new AAAARecord(hostname,
                                                DClass.IN, 3600, Address
View Full Code Here


        if (rr != null && rr.length > 0) {
            records = new ArrayList();
            for (int i = 0; i < rr.length; i++) {
                switch (rr[i].getType()) {
                    case Type.A:
                        ARecord a = (ARecord) rr[i];
                        records.add(a.getAddress().getHostAddress());
                        break;
                    case Type.AAAA:
                        AAAARecord aaaa = (AAAARecord) rr[i];
                        records.add(aaaa.getAddress().getHostAddress());
                        break;
View Full Code Here

                records = new ArrayList();
                for (int i = 0; i < rr.length; i++) {
                    String res;
                    switch (recordType) {
                        case A:
                            ARecord a = (ARecord) rr[i];
                            res = a.getAddress().getHostAddress();
                            break;
                        case AAAA:
                            AAAARecord aaaa = (AAAARecord) rr[i];
                            res = aaaa.getAddress().getHostAddress();
                            break;
View Full Code Here

        new Expectations() {
            {
                lookup.run();
                result =
                        new Record[] {
                                new ARecord(HOST1_EXAMPLE_COM_NAME, 0, 0, IP1),
                                new ARecord(HOST1_EXAMPLE_COM_NAME, 0, 0, IP2)

                        };

            }
        };
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 SIGRecord(m_name, DClass.IN, m_ttl, Type.A, 0xF, 0xABCDEL,
           new Date(), new Date(), 0xA, m_name, new byte[ 0 ]);
  m_s2 = new SIGRecord(m_name, DClass.IN, m_ttl, Type.A, 0xF, 0xABCDEL,
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

                                        }
                                    }
                                } else {
                                    Object value = hm.get(type);
                                    if ("A".equals(type)) {
                                        records.add(new ARecord(hostname,
                                                DClass.IN, 3600, Address
                                                        .getByAddress((String) value)));
                                    } else if ("AAAA".equals(type)) {
                                        records.add(new AAAARecord(hostname,
                                                DClass.IN, 3600, Address
View Full Code Here

            return org.xbill.DNS.Address.getByAddress(name);
        } catch (UnknownHostException e) {
            Record[] records = lookupNoException(name, Type.A, "A");

            if (records != null && records.length >= 1) {
                ARecord a = (ARecord) records[0];
                return InetAddress.getByAddress(name, a.getAddress().getAddress());
            } else throw e;
        }
    }
View Full Code Here

            Record[] records = lookupNoException(name, Type.A, "A");
           
            if (records != null && records.length >= 1) {
                InetAddress [] addrs = new InetAddress[records.length];
                for (int i = 0; i < records.length; i++) {
                    ARecord a = (ARecord) records[i];
                    addrs[i] = InetAddress.getByAddress(name, a.getAddress().getAddress());
                }
                return addrs;
            } else throw e;
        }
    }
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.