How to resolve a host name from IP using JNDI/DNS service provider

Hi
I got two questions on JNDI/DNS service provider:
1) How to resolve a host name when i got an IP
I understand How I do it inverse.
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.dns.DnsContextFactory");
env.put(Context.PROVIDER_URL, "dns://"+server+"/"+domain);
DirContext ictx = new InitialDirContext(env);
Attributes attrs1 = ictx.getAttributes(host, new String[] {"A"});
2) This example above works when I specify the domain in the provider url.
If I am not specifing a domain but only the dns server I got an NameNotFoundException.
What should I do if I don't got the domain?
get the availible domains and loop on them?

Hi,
if your DNS server supports that, you can do a reverse DNS lookup. This works as follows:
String server = "your.dns.server";
String domain = "in-addr.arpa";
String ip = "4.3.2.1";
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.dns.DnsContextFactory");
env.put(Context.PROVIDER_URL, "dns://" + server + "/" + domain);
DirContext ictx = new InitialDirContext(env);
Attributes attrs1 = ictx.getAttributes(ip, new String[] {"PTR"});1: Use the pseudo-domain in-addr.arpa
2: Use the reverse IP address for lookup, i.e. if your host has 1.2.3.4, use 4.3.2.1!!
3: Request the PTR attribute
see also [http://en.wikipedia.org/wiki/Reverse_DNS_lookup|http://en.wikipedia.org/wiki/Reverse_DNS_lookup]
Martin

Similar Messages

  • How can I get the host name from Email address?

    hi
    When I using socket to develope an email-sending servlet,I don't know how to get the host name from emial address.can you help me,thanks

    Stripping off the user name will give you the domain of from field in the message. This is not the same as the host. Take a look at:
    http://www.stopspam.org/email/headers/headers.html
    Theres a pretty good discussion about email headers and how to use the information. You probably want to check the information here against the RFC.
    Sean

  • Getting host name from applet

    Hi All,
    How can i get the local host name from applet ( Host name where the applet running) . While i tried with InetAddress i got only the loop back address 127.0.0.1. Can anyone help me out in this regard.
    Thanks in advance
    V.S.Saravanan

    When you say you tried the InetAddress, did you try the following?
    You could try creating a Socket connection back to the host/server URL from where the Applet was downloaded (you should have permission to do this). You can then get the local address of the Socket.
    Something like:
    String hostName = getCodeBase();
    Socket s = new Socket( hostName, portNum );
    InetAddress address = s.getLocalAddress();
    String hostName = address.getHostName();
    Eric

  • Discoverer Report: How to find Business Area name from Report Name.

    Hi
    I opened a report in Disco Desktop 4 -> Resonsibiolity --> Report Name.
    So I know Report name but don’t know which Business Area it belongs to.
    How to find Business Area Name from Report Name?
    Cheers
    Vijay

    Hi,
    There is no relationship between reports and business areas. Each report can be built from many folders. Each folder can be in many business areas.
    However you can try the following SQL which may give you the result you want for an v5 EUL. You will have to modify for Discoverer 4 EUL:
    select distinct doc_name, obj.obj_name folder_name, bas.ba_name
    from eul_us.eul5_documents doc
    , eul_us.eul5_elem_xrefs xref
    , eul_us.eul5_expressions exp
    , eul_us.eul5_objs obj
    , eul_us.eul5_ba_obj_links bol
    , eul_us.eul5_bas bas
    where xref.ex_from_id = doc.doc_id
    and doc.doc_name = &your_report
    and xref.ex_to_id = exp.exp_id
    and obj.obj_id = exp.it_obj_id
    and bol.bol_obj_id = obj.obj_id
    and bas.ba_id = bol.bol_ba_id
    Rod West

  • How to pull only column names from a SELECT query without running it

    How to pull only column names from a SELECT statement without executing it? It seems there is getMetaData() in Java to pull the column names while sql is being prepared and before it gets executed. I need to get the columns whether we run the sql or not.

    Maybe something like this is what you are looking for or at least will give you some ideas.
            public static DataSet MaterializeDataSet(string _connectionString, string _sqlSelect, bool _returnProviderSpecificTypes, bool _includeSchema, bool _fillTable)
                DataSet ds = null;
                using (OracleConnection _oraconn = new OracleConnection(_connectionString))
                    try
                        _oraconn.Open();
                        using (OracleCommand cmd = new OracleCommand(_sqlSelect, _oraconn))
                            cmd.CommandType = CommandType.Text;
                            using (OracleDataAdapter da = new OracleDataAdapter(cmd))
                                da.ReturnProviderSpecificTypes = _returnProviderSpecificTypes;
                                //da.MissingSchemaAction = MissingSchemaAction.AddWithKey;
                                if (_includeSchema == true)
                                    ds = new DataSet("SCHEMASUPPLIED");
                                    da.FillSchema(ds, SchemaType.Source);
                                    if (_fillTable == true)
                                        da.Fill(ds.Tables[0]);
                                else
                                    ds = new DataSet("SCHEMANOTSUPPLIED");
                                    if (_fillTable == true)
                                        da.Fill(ds);
                                ds.Tables[0].TableName = "Table";
                            }//using da
                        } //using cmd
                    catch (OracleException _oraEx)
                        throw (_oraEx); // Actually rethrow
                    catch (System.Exception _sysEx)
                        throw (_sysEx); // Actually rethrow
                    finally
                        if (_oraconn.State == ConnectionState.Broken || _oraconn.State == ConnectionState.Open)
                            _oraconn.Close();
                }//using oraconn
                if (ds != null)
                    if (ds.Tables != null && ds.Tables[0] != null)
                        return ds;
                    else
                        return null;
                else
                    return null;
            }r,
    dennis

  • How do I remove my name from an ipod prior to donating it to someone?

    I would like to donate my ipod touch to someone as I just bought another one. How do I remove my name from the device prior to donating it? I was able to remove all of my apps, music and videos but not the name.

    Go into your settings>general>reset, then select Erase All Content and Settings. 

  • How to check my job name from the database...

    I have written one job scheduler which is as follows :
    SQL> ED
    Wrote file afiedt.buf
    1 DECLARE
    2 X NUMBER;
    3 JobNumber NUMBER;
    4 BEGIN
    5 SYS.DBMS_JOB.SUBMIT
    6 (
    7 job => X
    8 ,what => 'scott.SPLITSMS;'
    9 ,next_date => SYSDATE+1/1440
    10 ,interval => 'SYSDATE+1/1440 '
    11 ,no_parse => FALSE
    12 );
    13 JobNumber := to_char(X);
    14* END;
    15 /
    PL/SQL procedure successfully completed.
    Now I want to check whether the job has been really created or not?
    so for that I have used the following command line:
    SQL> SELECT JOB_NAME FROM DBA_SCHEDULER_JOBS WHERE JOB_NAME = 'SCOTT.SPLITSMS';
    SELECT JOB_NAME FROM DBA_SCHEDULER_JOBS WHERE JOB_NAME = 'SCOTT.SPLITSMS'
    ERROR at line 1:
    ORA-00942: table or view does not exist
    how to check my job name from the database...
    what is the command used to check the job_name ????
    and how can i ensure that my job scheduler is running properly...???
    please help ........my dear friends.....!

    957029 wrote:
    Now I want to check whether the job has been really created or not?
    so for that I have used the following command line:
    SQL> SELECT JOB_NAME FROM DBA_SCHEDULER_JOBS WHERE JOB_NAME = 'SCOTT.SPLITSMS';
    SELECT JOB_NAME FROM DBA_SCHEDULER_JOBS WHERE JOB_NAME = 'SCOTT.SPLITSMS'
    ERROR at line 1:
    ORA-00942: table or view does not existYou can use DBA_* views only if the User has been Granted a DBA Privilege.
    how to check my job name from the database...
    what is the command used to check the job_name ????You can use USER_JOBS view to check. But, is it not that you have just created the Job, so you must be knowing it?
    and how can i ensure that my job scheduler is running properly...???If USER_JOBS.FAILURES is Non Zero, that means the Job has encountered a problem that needs to be Investigated. Similarly, the LAST_DATE, LAST_SEC, NEXT_DAY, NEXT_SEC can be used to determine if the Job has been running successfully.
    if you are on 11g, you should consider using DBMS_SCHEDULER.

  • How to retrieve the parameter names from a JSP page ? Urgent Please

    Hello,
    Can anybody tell me how to retrieve the parameter names from the JSP
    page. (without using getParameterNames() method.)
    The problem with the getParameterNames() method is I get the Jumbled output.
    I need it very badly
    With regards
    Ananth R
    email:[email protected]
    [email protected]

    Dear duffymo,
    My primary intention is to convert the JSP form information into a XML file.
    If I do not get the Parameter names in the correct order how can I maintain
    tag order in XML file.
    For ex: (JSP PAGE VIEW)
    Name--
    FirstName
    MiddleName
    LastName
    Address--
    Street1
    Street2
    City
    Country
    &so on
    (XML File to be generated)
    <Name>
    <FirstName>Value</FirstName>
    </Name>
    <Address>
    <street1>value</street1>
    </Address>
    & so on
    If I use getParameterNames() to get all the parameter names(Which form the tag names in the XML file ) the Enumeration object it returns will not be in the same order as the text fields in JSP.From this I can not construct a meaningful XML file.
    order means: Order of entry on the page, from top to bottom
    That's it
    Waiting for your responses

  • How to find the form name  from VA02 T.code

    how to find the form name  from VA02 T.code

    Hi Rajyam,
    I guess you are looking out for the formname which prints sales related documents.
    If this is what you want,then go to the T-code NACE and select the option K1Sales activities and click on the Output Types button on the top.The new window has all the types of Output types listed.Select the most appropriate and double click on the Processing routines button in the left side screen.
    The new window lists the program names and the forms associated with that output type.
    In case you have any further clarifications,do let me know.
    Regards,
    Puneet Jhari.

  • How to find the dsn name from an *.rpd file provided?

    How to find the dsn name from an *.rpd file provided? All the ODBC details which would require to run your dashboard.

    Hi
    DSN name is not a part of .rpd file. So There is no information about DSN name in .rpd file.
    Thanks
    Siddhartha P

  • I have a Domain name with email forwarding to my Service Provider which worked very well when I had a PC. Now I have iMac and have changed to IMAP from POP3 so I can sync. between iMac and iPad but how?

    I have a Domain name with email forwarding to my Service Provider which worked very well when I had a PC. Now that I have iMac I have changed the account type to IMAP from POP3 so I can sync. between iMac and iPad but how?
    I do receive emails into my iMac for which I have 3 email accounts but am struggling on how synchronise between iMac and iPad so that both are up to date at all times.  I have also set up a iCloud email account thinking this was the way to go but have drawn a blank.
    Any help would be very much appreciated.

    Linc Davis,
    I have set up my email address both within my iMac and my ISP as IMAP accounts and I receive all emails without problem on my iMac. I have also set up an iCloud email address using my iMac.
    I have enabled the email within "setting" on my iPad and have used the iCloud account.  I have sent emails from the iMac to iPad using the iCloud account address and vice versa.  I have also sent emails from the iPad to the iMac using my non-iCloud email address and they have gotten through.
    The one thing I would like to have is for the iPad "mail" mailboxes to mimic the iMac "mail" mailboxes and both to be "in sync".  I am not really interested in using the iCloud email address for my email but would really like to use my "normal" addresses as these are what most people know me by.
    Do I need to set additional accounts within the iPad which are the same as the email accounts I have within the iMac and my ISP?  I have reached the end of my knowledge as regards email synchronsing.
    Thanks

  • Nokia 6300: How do I remove a name from a dictiona...

    Hi
    I was hoping someone knows how to remove a word/name from the word prompter on my phone. That is when I type the keys on word prompt how do I remove a name I do not want to come up
    Thanks
    Lee

    Hi,
    Try this. Messaging> Message> Options> Prediction Off.

  • How to find a metachain name from local process chain id or name

    how to find a metachain name from local process chain id or name

    Hi Dwarakanath,
    Please post your query in the correct topic space in SCN.  For help, see this document:
    Find Topic Spaces on SCN (Forums)
    Thanks,
    Kristen

  • How I transfer my contact names from my Iphone 4S to my Ipad Air ( only showing phone numbers but no names )

    How I transfer my contact names from my Iphone 4S to my Ipad Air ( only showing phone numbers but no names ) If I receive a message in my Ipad Air, just the phone number is available, I want to find out if possible to get the name of the contact also ?

    Go to Settings>iCloud on your phone, make sure you are signed into the iCloud account that contains your contacts, the turn Contacts to On.  When prompted, choose merge.

  • How stream Video at host, at me site using Adobe Flash Media Streaming?

    Please help me how stream Video at host, at me site using Adobe Flash Media Streaming? With using localhost and my ip I can just watch streaming in my computer. How should i configure my server to watch streaming at my site?
    Please help!
    Thank you!

    Petro,
    I have chacked code and changed src.
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    <head>
    <title>SWFObject 2 static publishing</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <script type="text/javascript" src="scripts/swfobject.js"></script>
    <script type="text/javascript">
    swfobject.registerObject("flashId", "9.0.0", "flash/expressInstall.swf");
    </script>
    </head>
    <body>
    <div>
    <object width="600" height="409"> <param name="movie" value="http://fpdownload.adobe.com/strobe/FlashMediaPlayback_101.swf"></param><param name="flashvars" value="src=http://192.168.100.4/hds-live/livepkgr/_definst_/liveevent/livestream.f4m&poster=http%3A%2 F%Fosmf.org%2Fimages%2Fposter_cathy_fmp.jpg&autoPlay=true"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://fpdownload.adobe.com/strobe/FlashMediaPlayback_101.swf" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true"  width="600" height="409" flashvars="src=http://192.168.100.4/hds-live/livepkgr/_definst_/liveevent/livestream.f4m&poster=http%3A%2 F%2Fosmf.org%2Fimages%2Fposter_cathy_fmp.jpg&autoPlay=true"></embed></object>
    <!--<![endif]-->
    </object>
    </div>
    </body>
    </html>
    But anyway I am facing same problem as I wrote already. I can see streaming just in my computer. From other computers it's writing error log. What should I do? Maybe I am trying to stream video at my site in a wrong way? I am using Adobe flash media Live Emcoder with Adobe flash Media Server 4.5. In my computer everything works fine. But I can't stream to otyer cimputers. Please help.

Maybe you are looking for

  • Qosmio G30 installation problem

    Hello all guys I have a huge problem I have a Qosmio G30, recently recurrence, or used the disk, format it, confg. RAID, it will restart the formatting begins, ends restarts, and the problem here. At the restart should take at the end of installation

  • Wi-fi access in Canada

    I am Australian and going to Canada. Hoping to take my MacBook and connect to wi-fi services there. Do I need to set anything up on the computer before I go. It has built in AirPort Extreme (802.11n). Can I just go and click safari when there and up

  • Media Encoder cs6 download?

    Flash typically comes with media encoder but my download of Flash CS 6 did not install CS6 media Encoder and I need it to create an flv file since Adobe stupidly deprecated the format in subsequent versions of Media Encoder. All links I've found so f

  • Alternative for UTL_INADDR.GET_HOST_ADDRESS

    Hi, Please help me on this below. Right now we are using below query to find the MAC address SELECT UTL_INADDR.GET_HOST_ADDRESS FROM dualIs there any other option to find MAC address instead of UTL_INADDR.GET_HOST_ADDRESS.

  • How to connect text boxes so that text flows from different boxes to others, on same page or other pages?

    How do you connect Text Boxes?  So that text flows from one to the other, on same page or following pages?