Code Monkey home page Code Monkey logo

react-native-dns-lookup's Introduction

react-native-dns-lookup

Community Supported

A React Native module that leverages iOS and Android native networking libraries to lookup all of the IP addresses associated with a hostname

Usage

import { getIpAddressesForHostname } from 'react-native-dns-lookup';

// For a given hostname, returns a promise that resolves with an array of strings
// containing all of the ip addresses associated with the hostname.
getIpAddressesForHostname("github.com").then(ipAddresses => console.log(ipAddresses));

// Output: ["192.30.255.112", "192.30.255.113"]

Installation

$ npm install react-native-dns-lookup --save

or

$ yarn add react-native-dns-lookup --save

Contributions

Code contributions and improvements by the community are welcomed! See the LICENSE file for current open-source licensing and use information.

Before we can accept pull requests from contributors, we require a signed Contributor License Agreement (CLA),

react-native-dns-lookup's People

Contributors

avertin avatar ibotpeaches avatar mmathewstableau avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-native-dns-lookup's Issues

Unable to build React Native project after linking react-native-dns-lookup

Hi,

I'm currently looking into DNS Lookup modules for react native and came across this project as it looked perfect for what I needed.

However after adding it to my project I have been unable to get my builds to work.

I ran react-native link react-native-dns-lookup and everything looks fine except for this error when I build.

The following error occurs in RNDnsLookup.m

image

Any help would be greatly appreciated.

SRV records is not working

I have tried SRV records and it's throwing Error: Unable to resolve host "SRV-URL": No address associated with hostname. could you please help with the error? Please find the code snippet below.

getIpAddressesForHostname("SRV-url").then(ipAddresses => console.log(ipAddresses));

Custom DNS resolver

Is there any way by which we can use a custom DNS resolver like Cloudflare 1.1.1.1 ?

getIpAddresses - TypeError: null is not an object

When building on iOS with XCode 11.4.1 and RN 0.62.2 I get the error, "TypeError: null is not an object (evaluating RNDnsLookup.getIpAddresses)" at runtime when getIpAddressesForHostname is called. I have tried both auto and manual linking. My Android build runs without any issue.

Resolving local hostnames?

Hi. First of all i want to thank you for this package. You did a great job.
My question is, can i use this package to get local ip using mdns hostname (ended with .local)?
If so, can you provide an example?

Unable to resolve after first unsuccessful call

In the following scenario, calling getIpAddressesForHostname never sends the correct result :

  1. Call getIpAddressesForHostname with toto.domain.com => Sends []
  2. Add an A record toto.domain.com pointing to some IP address (AWS Elastic IP)
  3. Call getIpAddressesForHostname with toto.domain.com => Sends [] indefinitely

If we donc call getIpAddressesForHostname before adding the record, then it resolves correctly. Is there something specific to do for this ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.