Skip to content

This project provides an express function to parse an IPv4 address from a valid domain name.

License

Notifications You must be signed in to change notification settings

PerfectSideRepos/Perfect-DNSParser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Perfect DNS Parser 简体中文

Get Involved with Perfect!

Star Perfect On Github Stack Overflow Follow Perfect on Twitter Join the Perfect Slack

Swift 3.0 Platforms OS X | Linux License Apache PerfectlySoft Twitter Slack Status

This project provides an express function to parse an IPv4 address from a valid domain name.

This package builds with Swift Package Manager and is part of the Perfect project. It was written to be stand-alone and so does not require PerfectLib or any other components.

Ensure you have installed and activated the latest Swift 3.1 tool chain.

Quick Start

Add dependencies to your Package.swift:

.Package(url: "https://github.com/PerfectSideRepos/Perfect-DNSParser.git", majorVersion: 1)

Import Library

import PerfectDNSParser

Get IP address from a domain name:

if let ip = "perfect.org".parseDNS() {

  // print out the ip address, and it will be "65.39.133.132" if success
  print(ip)
}//end if

API

Perfect DNSParser library expends the String class with a new function: func parseDNS(_ service: String = "http") -> String?, which can get IPv4 address from current host DNS name.

  • parameter: (optional) service. i.e., the internet service port, such as "http" (default), "ftp", "https" or "ssh", etc.
  • returns: ip address if success, or nil if something wrong.

Issues

We are transitioning to using JIRA for all bugs and support related issues, therefore the GitHub issues has been disabled.

If you find a mistake, bug, or any other helpful suggestion you'd like to make on the docs please head over to http://jira.perfect.org:8080/servicedesk/customer/portal/1 and raise it.

A comprehensive list of open issues can be found at http://jira.perfect.org:8080/projects/ISS/issues

Further Information

For more information on the Perfect project, please visit perfect.org.

Now WeChat Subscription is Available (Chinese)

About

This project provides an express function to parse an IPv4 address from a valid domain name.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages