Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8547955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:22:57+00:00 2026-06-11T13:22:57+00:00

Given a domain and a nameserver ip I’d like to know where is that

  • 0

Given a domain and a nameserver ip I’d like to know where is that nameserver resolving the IP in java, how can I achieve it? Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T13:22:58+00:00Added an answer on June 11, 2026 at 1:22 pm

    You have at least two options:

    If your code has to run on any VM, you must use one of the many available Java DNS libraries. Googling for “java dns library” will give you many options.

    If your code is only going to run on a Sun/Oracle VM, you can use the proprietary JNDI DNS provider like this:

    Hashtable<String, Object> env = new Hashtable<String, Object>();
    env.put("java.naming.factory.initial", "com.sun.jndi.dns.DnsContextFactory");
    env.put("java.naming.provider.url",    "dns://<your DNS server>");
    
    DirContext ictx = new InitialDirContext(env);
    Attributes attrs = ictx.getAttributes("www.heise.de", new String[] {"A", "AAAA"});
    
    NamingEnumeration<? extends Attribute> e = attrs.getAll();
    while(e.hasMoreElements()) {
        Attribute a = e.next();
        System.out.println(a.getID() + " = " + a.get());
    }
    

    This example will query the specified DNS server for all A and AAAA records for the host http://www.heise.de:

    A = 193.99.144.85

    AAAA = 2a02:2e0:3fe:100::7

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given the following URL: domain.com/page.aspx?id=123 How can I sanitize that query string value when
I am writing a script that checks if given domain is parked or not.
How can I get an IP address, given a domain name? For example: www.test.com
Given systems A and B, how can i reference domain entities from system A
Given that the web application doesn't have su privileges, I'd like to execute a
How to get List of LDAP servers given a domain name (using java +
Given a domain object (say, for example, Person), should that object contain its Data
Given, a similar setup like ebay... Domains: domain.com domain.de domain.it domain.ru domain.xyz .... BUT:
Given an email address (ex: goelv@example.com), how do I validate that the domain (example.com)
Given a domain object: class BirthdayDomain { public DateTime Birthday { get; set; }

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.