Adobe
Products

Top destinations

  • Adobe Creative Cloud
  • Creative Suite
  • Adobe Marketing Cloud
  • Acrobat
  • Photoshop
  • SiteCatalyst
  • Students
  • Elements family

Adobe Creative Cloud

  • What is Adobe Creative Cloud?
  • Design
  • Web
  • Photography
  • Video
  • Students
  • Teams
  • Enterprise
  • Educational institutions

Design and photography

  • Photoshop
  • Illustrator
  • InDesign
  • Adobe Muse
  • Lightroom

Video

  • Adobe Premiere
  • After Effects

Web development and HTML5

  • Edge Tools & Services [opens in a new window]
  • Dreamweaver
  • Gaming [opens in a new window]

Adobe Marketing Cloud

  • What is Adobe Marketing Cloud?
  • Digital analytics
  • Social marketing
  • Web experience management
  • Testing and targeting
  • Media optimization

Analytics

  • SiteCatalyst
  • Adobe Discover
  • Insight

Social

  • Adobe Social

Experience Manager

  • CQ
  • Scene7

Target

  • Test&Target
  • Recommendations
  • Search&Promote

Media Optimizer

  • AdLens
  • AudienceManager
  • AudienceResearch

Document services

  • Acrobat
  • EchoSign [opens in a new window]
  • FormsCentral [opens in a new window]
  • SendNow [opens in a new window]
  • Acrobat.com [opens in a new window]

Publishing

  • Digital Publishing Suite

  • See all products
Business solutions

By business need

  • Digital analytics
  • Digital publishing
  • Document management
  • Media optimization
  • Social marketing
  • Testing and targeting
  • Video editing and serving
  • Web development [opens in a new window]
  • Web experience management
  • See all business needs

By industry

  • Broadcast
  • Education
  • Financial services
  • Government
  • Publishing
  • Retail
  • See all industries
Support & Learning

I need help

  • Products
  • Adobe Creative Cloud
  • Adobe Marketing Cloud
  • Forums [opens in a new window]

I want to learn

  • Training and tutorials
  • Certification [opens in a new window]
  • Adobe Developer Connection
  • Adobe Design Center
  • Adobe TV [opens in a new window]
  • Adobe Marketing Center
  • Adobe Labs [opens in a new window]
Download
  • Product trials
  • Adobe Flash Player
  • Adobe Reader
  • Adobe AIR
  • See all downloads
Company
  • Careers at Adobe
  • Investor Relations
  • Newsroom
  • Privacy
  • Corporate Social Responsibility
  • Customer Showcase
  • Contact us
  • More company info
Buy
  • For personal and professional use
  • For students, educators, and staff
  • For small and medium businesses
  • Volume Licensing
  • Special offers
  • Adobe Marketing Cloud sales [opens in a new window]
Search
 
Info Sign in
Why sign in? Sign in to manage your account and access trial downloads, product extensions, community areas, and more.
Welcome,
My Adobe
My orders
My information
My preferences
My products and services
Sign out
My cart
Privacy My Adobe
Adobe
Products Sections Buy   Search  
Solutions Company
Help Learning
Sign in Sign out Privacy My Adobe
Preorder Estimated Availability Date. Your credit card will not be charged until the product is shipped. Estimated availability date is subject to change. Preorder Estimated Availability Date. Your credit card will not be charged until the product is ready to download. Estimated availability date is subject to change.
Qty:
Purchase requires verification of academic eligibility
Subtotal
Promotions
Estimated shipping
Tax
Calculated at checkout
Total
Review and Checkout
Adobe Developer Connection / Adobe AIR Developer Center /

Resolving DNS records in Adobe AIR 2

by William Liang

William Liang

Modified

8 February 2010

Page tools

Share on Facebook
Share on Twitter
Share on LinkedIn
Bookmark
Print
ActionScriptAdobe AIRFlexnetworking
Was this helpful?
Yes   No

By clicking Submit, you accept the Adobe Terms of Use.

 
Thanks for your feedback.

Requirements

Prerequisite knowledge

This article is intended for developers who are comfortable with ActionScript and who have a basic understanding of networking and DNS.

User level

All

Required products

  • Adobe AIR

Among the new networking features introduced in Adobe AIR 2 is the Domain Name System (DNS) resolver. DNS is a naming system in which network resources such as domains, servers, services, and so on are mapped to information such as IP addresses. The new DNS resolver enables DNS resolution within an AIR application and helps to facilitate networking related operations, including the establishment of network connections.

DNS resolver use cases

To end users, DNS resolution is generally a transparent feature of a network-enabled application. Web browsers, email clients, and other similar applications are just a few examples of applications that rely on DNS.

For example, when a user types the name of a web site in a browser, they are actually typing a Uniform Resource Locator (URL) containing a domain name. The browser contains a DNS resolver feature that allows it to perform a DNS lookup on the domain name. The result of the lookup is an IP address that the browser uses to request and load the content from the website.

In AIR 2, you can now incorporate DNS resolution within your application. Using the new DNSResolver class, you can build familiar applications such as web browsers and email clients, or you can build applications with more sophisticated features such as IP telephony or peer-to-peer file sharing.

DNS records

The new DNSResolver class resolves domain names by performing a standard DNS query. The result of the DNS query is a DNS response containing the DNS records for that query. The information contained within the DNS records will depend on the type of the DNS resource record. DNS supports many different records types. The DNSResolver class supports the following subset of record types:

  • A: An A record maps an IPv4 address to a hostname. It contains the hostname, time-to-live (TTL), and IPv4 IP address.
  • AAAA: An AAAA record maps an IPv6 address to a hostname. It contains the hostname, TTL, and IPv6 IP address.
  • MX: An MX record maps a list of mail servers to a domain name. It contains the hostname, TTL, exchange server, and preference.
  • PTR: A PTR record maps a hostname to an IP address. This is essentially a reverse DNS lookup. A PTR record contains the hostname, TTL, and a pointer to the host.
  • SRV: An SRV record maps a list of services to a domain name. It contains the hostname, TTL, priority, weight, port, and target domain.

DNSResolver example

To enable DNS resolution within an AIR application, you will need to create a DNSResolver object and add an event listener to handle lookup events. The lookup event will return records from a DNS response. An example of this is shown below:

import flash.net.dns.DNSResolver; import flash.net.dns.ARecord; import flash.net.dns.AAAARecord; import flash.net.dns.MXRecord; import flash.net.dns.PTRRecord; import flash.net.dns.SRVRecord; var dnsResolver:DNSResolver = new DNSResolver(); public function init():void { dnsResolver.addEventListener("lookup", lookupHandler); } public function lookupHandler(event:DNSResolverEvent):void { var records:Array = new Array(); records = event.resourceRecords; var name:String = "Name: " + records[0].name; var ttl:String = "TTL: " + records[0].ttl; if (records[0] is ARecord) { var addr:String = "Addr: " + records[0].address; } elseif (records[0] is MXRecord) { var exchange:String = "Exchange: " + records[0].exchange; var preference:String = "Preference: " + records[0].preference; } elseif (records[0] is PTRRecord) { var ptr:String = "PTR: " + records[0].ptrdName; } elseif (records[0] is SRVRecord) { var priority:String = "Priority: " + records[0].priority; var weight:String = "Weight: " + records[0].weight; var port:String = "Port: " + records[0].port; var target:String = "Target: " + records[0].target; } }

An A record example

To make an A record request, call the DNSResolver lookup function with the hostname and record type as shown below.

public function lookupA():void { dnsResolver.lookup("echotest.adobepacifica.net", ARecord); }

In this example, the DNS response would be the following:

Name: echotest.adobepacifica.net TTL: 7200 Addr: 192.168.0.1

AAAA record example

To make an AAAA record request, you can use the example above for making an A record request, but specify AAAARecord as the type in place of ARecord.

MX record example

To make an MX record request, call the DNSResolver lookup function with the domain name and record type as shown below.

public function lookupMX():void { dnsResolver.lookup("echotest.adobepacifica.net", MXRecord); }

In this example, the DNS response would be the following:

Name: echotest.adobepacifica.net TTL: 528 Exchange: mail.echotest.adobepacifica.net Preference: 10

PTR record example

To make a PTR record request, call the DNSResolver lookup function with the IP address and record type as shown below.

public function lookupPTR():void { dnsResolver.lookup("65.49.27.91", PTRRecord); }

In this example, the DNS response would be the following:

Name: 91.subnet64.27.49.65.in-addr.arpa TTL: 557721 PTR: reverse.echotest.adobepacifica.net

SRV record example

To make an SRV record request, call the DNSResolver lookup function with the service name and record type as shown below.

public function lookupSRV():void { dnsResolver.lookup("_sip._udp.adobepacifica.net", SRVRecord); }

In this example, the DNS response would be the following:

Name: _sip._udp.adobepacifica.net TTL: 14071 Priority: 0 Weight: 1 Port: 5060 Target: adobepacifica.net

Where to go from here

For further information about the DNSResolver class and its usage, please refer to the AIR 2 release notes.

More Like This

  • Creating a socket server in Adobe AIR 2
  • Creating accessible Adobe AIR applications with the Flex SDK
  • Using the SQLite database access API in Adobe AIR
  • Using the Salesbuilder Adobe AIR sample application
  • Building multilingual Flex applications on Adobe AIR
  • Building an XML viewer on Adobe AIR with Flex
  • Using drag-and-drop support of remote files in Adobe AIR 2
  • Using the Microphone capabilities in Adobe AIR 2
  • Writing multiscreen AIR apps
  • Retrieving a list of network interfaces in Adobe AIR 2

Tutorials & Samples

Tutorials

  • Retrieving a list of network interfaces in Adobe AIR 2
  • Writing multiscreen AIR apps
  • Resolving DNS records in Adobe AIR 2
  • Creating a socket server in Adobe AIR 2

Samples

  • Using the Salesbuilder Adobe AIR sample application

Adobe AIR Forums

More
04/26/2013 Get the country in iOS
04/26/2013 IOS app rejected due to a blank, black screen upon launch
01/28/2013 FullScreen Scale Amount?
03/13/2013 How to use R.resource in Java from ANE?

Adobe AIR Blog

More
05/19/2013 Send texture from unity to flash via sockets.
05/18/2013 Spaceport: the Adobe AIR alternative The free, cross-platform...
05/15/2013 Adobe Flash Professional with CreateJS
05/11/2013 “You uploaded an APK with Invalid or Missing Signing Information for Some of Its files” Google Play, Adobe Air Error

Products

  • Adobe Creative Cloud
  • Creative Suite
  • Adobe Marketing Cloud
  • Acrobat
  • Photoshop
  • Digital Publishing Suite
  • Elements family
  • SiteCatalyst
  • For education

Download

  • Product trials
  • Adobe Reader
  • Adobe Flash Player
  • Adobe AIR

Support & Learning

  • Product help
  • Forums

Buy

  • For personal and professional use
  • For students, educators, and staff
  • For small and medium businesses
  • Volume Licensing
  • Special offers

Company

  • News room
  • Partner programs
  • Corporate social responsibility
  • Career opportunities
  • Investor Relations
  • Events
  • Legal
  • Security
  • Contact Adobe
Choose your region United States (Change)
Choose your region Close

North America

Europe, Middle East and Africa

Asia Pacific

  • Canada - English
  • Canada - Français
  • Latinoamérica
  • México
  • United States

South America

  • Brasil
  • Africa - English
  • Österreich - Deutsch
  • Belgium - English
  • Belgique - Français
  • België - Nederlands
  • България
  • Hrvatska
  • Česká republika
  • Danmark
  • Eastern Europe - English
  • Eesti
  • Suomi
  • France
  • Deutschland
  • Magyarország
  • Ireland
  • Israel - English
  • ישראל - עברית
  • Italia
  • Latvija
  • Lietuva
  • Luxembourg - Deutsch
  • Luxembourg - English
  • Luxembourg - Français
  • الشرق الأوسط وشمال أفريقيا - اللغة العربية
  • Middle East and North Africa - English
  • Moyen-Orient et Afrique du Nord - Français
  • Nederland
  • Norge
  • Polska
  • Portugal
  • România
  • Россия
  • Srbija
  • Slovensko
  • Slovenija
  • España
  • Sverige
  • Schweiz - Deutsch
  • Suisse - Français
  • Svizzera - Italiano
  • Türkiye
  • Україна
  • United Kingdom
  • Australia
  • 中国
  • 中國香港特別行政區
  • Hong Kong S.A.R. of China
  • India - English
  • 日本
  • 한국
  • New Zealand
  • 台灣

Southeast Asia

  • Includes Indonesia, Malaysia, Philippines, Singapore, Thailand, and Vietnam - English

Copyright © 2013 Adobe Systems Incorporated. All rights reserved.

Terms of Use | Privacy | Cookies

Ad Choices

Reviewed by TRUSTe: site privacy statement