SOL9 Sample: DnsRecordCreator

SOL9 2.0 Samples

1 Screenshot


2 Source code

/*
 * DnsRecordCreator.cpp 
 * Copyright (c) 2015 Antillia.com TOSHIYUKI ARAI. ALL RIGHTS RESERVED. 
 */


// SOL9
// 2011/1/16
#include <sol/WSAInitializer.h>
#include <sol/dns/DnsRecordCreator.h>
#include <sol/dns/DnsContext.h>
#include <sol/Locale.h>

void _tmain(int argc, TCHAR** argv)
{

  WSAInitializer initializer;
  Locale locale;
  try {

    DnsRecordCreator creator;
    DNS_A_DATA ip4Data;
    creator.create(ip4Data, _T("test.localdomain.com"), DNS_TYPE_A, _T("192.168.1.1"));

    DNS_AAAA_DATA ip6Data;
    creator.create(ip6Data, _T("test.localdomain.com"), DNS_TYPE_AAAA, _T("2001:0db8:ffff::80"));

    DNS_MX_DATA   mxData;
    creator.create(mxData, _T("test.localdomain.com"), DNS_TYPE_MX, _T("smtp.test.localdomain.com"), 400);

    creator.display();

  } catch (Exception& ex) {
    ex.printf();
  } catch (...) {
    _tprintf(_T("Exception\n"));
  }
}

Last modified: 2 May 2016

Copyright (c) 2016 Antillia.com ALL RIGHTS RESERVED.