Finding LDAP server names by DNS lookup.

Hi,
I'm very new with JNDI and DNS
We are hardcoding the ldap server name in our configuration to connect to the Active directory, but the requirement is to know the ldap server name dynmaically by querying the DNS server.
The input given to us are below.
Dns domain : indbank.is.
SRV RRecord : ldap.tcp.
Query dns : ldap.tcp.indbank.is.
The domain controller should be found by a DNS lookup for the domain, then a DNS for Domain controllers that advertise the service, then try to see if the domain controllers areanswering, and if so choose the one with the fastest answer time (to avoid choosing a domain controller over WAN).
Kindly help me.I am beginner and some code sample and tip will be welcome. :)
Thanks in advance.
Hiubert

Thanks a lot to All.
My code is as follows...
import javax.naming.*;
import javax.naming.directory.*;
import java.util.*;
public class dns1
     public static void main(String[] args)     {
          try {
               Hashtable env = new Hashtable();
               env.put("java.naming.factory.initial","com.sun.jndi.dns.DnsContextFactory");
               env.put("java.naming.provider.url", "dns://indbank.is");
               DirContext ctx = new InitialDirContext(env);
               System.out.println("Intial context created...");
               Attributes attrs = ctx.getAttributes("_ldap._tcp.indbank.is",new String[] {"SRV"});
               System.out.println("Attributes are been retrieved...");
               for (NamingEnumeration ae = attrs.getAll();ae.hasMoreElements();)
                    Attribute attr = (Attribute)ae.next();
                    String attrId = attr.getID();
                    System.out.println("Attribute ID retrieved is" + attrId);
                    for (Enumeration vals = attr.getAll();vals.hasMoreElements(); System.out.println(attrId + ": " + vals.nextElement()));
               ctx.close();
          catch(Exception e)
               System.err.println("Problem querying DNS: " + e);
               e.printStackTrace();
The code runs fine and I get the output as follows
0 100 389 ib500ad1.indbank.in
0 100 389 ib500ad2.indbank.in
I have following questions
1) Do these servers which are returned are the domain controllers or the ldap servers.?(or both domaincontrollers and ldap server are same)
2) how to extract the server name alone from this string.
3) If these two server names are domain controllers then how can I query for a DNS for Domain controllers that advertise the service, then try to see if the domain controllers are answering, and if so choose the one with the fastest answer time (to avoid choosing a domain controller over WAN).
Thanks in advance.
-Hiubert

Similar Messages

  • Getting LDAP server name?

    How can I find the LDAP server name and port?
    I presume that the first 2 values are LDAP server name and port?
    InitialDirContext ctx = ConnectionUtil.getDefaultDirCtx("host", "port", "orcladmin", "pwd");
    Please help.
    Thanks

    Logon to Portal schema and run the below query:
    select wwsec_oid.get_oid_host "LDAP Host",wwsec_oid.get_oid_port "LDAP Port" from dual;

  • How to find out server name in reports9i

    hi all
    how to find out server name in reports9i
    i need the report server name to call a report
    thanks
    Edited by: vikas singhal on Nov 5, 2008 1:02 AM

    You do not need to do anything, if your Report server is on the same machine as the Forms server (which is usually the case) you simply use the url as
    /reports/rwservlet?report=myreport' and the server will automatically use the default report server.
    then you simply use
    web.show_document('/reports/rwservlet?userid=scott/tiger@orcl&report=myreport&desformat=htmlcss&desname=test.html'Tony
    Try it now
    Edited by: Tony Garabedian on Nov 5, 2008 2:00 PM

  • Where do i find the server name or URL?

    where do i find the server name or URL for my icloud account

    Why do you need this?
    Are you trying to setup your iCloud email on a non Apple Email client?
    If so:
    iCloud: Mail server settings for email clients - Apple Support

  • How to find SMTP server name on AIX 5.3 ?

    Hi All/Guru
    how can i find SMTP Server name on my aix server which i need to configure E-mail notification for database alerts.
    Thanks in advance.
    Tina

    Check in the file /etc/sendmail.cf

  • Using external LDAP server for  WL JNDI lookups

    I'm trying to find out if it is possible to re-direct JNDI calls to the WL
    server to an external LDAP server. I know you can install an external LDAP
    server for security purposes, but I would like to use an external LDAP
    server to handle all JNDI lookups (like for JNDI EJB name location, etc.).
    Is this possible?

    You typically need to use our JNDI store. We strongly recommend this for
    performance reasons..
    You can use the JNDI To LDAP bridge which is available from the sun web
    site.
    Michael Girdley
    BEA Systems Inc
    "Jack Archer" <[email protected]> wrote in message
    news:[email protected]..
    I'm trying to find out if it is possible to re-direct JNDI calls to the WL
    server to an external LDAP server. I know you can install an external LDAP
    server for security purposes, but I would like to use an external LDAP
    server to handle all JNDI lookups (like for JNDI EJB name location, etc.).
    Is this possible?

  • New Edge server fails with DNS lookups - incoming mail stuck in queue

    I just setup an Edge server, together with 2 Ex2013 servers with DAG. Sync works fine, however incoming mails are stuck at the edge server. The queue looks like this:
    451 4.4.0 DNS query failed. The error was: DNS query failed with error ErrorRetry
    Checking the logs, it also shows errors like this:
    2014-07-12T16:32:06.599Z,08D16C05D02E2774,SMTP,"ex2.internal.contoso.com,ex3.internal.contoso.com,ex4.internal.contoso.com",>,DNS server returned ErrorRetry reported by 0.0.0.0. [Domain:Result] = EX2.internal.contoso.com:ErrorRetry; EX3.internal.contoso.com:ErrorRetry; EX4.internal.contoso.com:ErrorRetry;
    2014-07-12T16:32:06.599Z,08D16C05D02E2774,SMTP,"ex2.internal.contoso.com,ex3.internal.contoso.com,ex4.internal.contoso.com",-,"Messages: 0 Bytes: 0 (The DNS query for 'SmartHostConnectorDelivery':'ex2.internal.contoso.com,ex3.internal.contoso.com,ex4.internal.contoso.com':'e01d6f93-e25b-4e36-9f2f-c1c7c73889ae' failed with error : ErrorRetry)"
    Now the network is a little special, as the edge server is not in DMZ, but simply in a workgroup in the same LAN as the other Exchange servers. The edge server NIC's are configured to use the internal AD DNS servers, and the edge server is able to lookup
    all the other exchange servers (ie. ex2.internal.contoso.com).
    So I wonder why the edge servers logs DNS lookup errors as long as the server it self can lookup the internal hostnames for Exchange.
    Any help would be great, as all incoming mail is now stuck at the edge server.

    This is from the Edge server:
    [PS] C:\Windows\system32>Get-SendConnector | fl
    AddressSpaces                : {smtp:*;100}
    AuthenticationCredential     :
    CloudServicesMailEnabled     : False
    Comment                      :
    ConnectedDomains             : {}
    ConnectionInactivityTimeOut  : 00:10:00
    DNSRoutingEnabled            : True
    DomainSecureEnabled          : True
    Enabled                      : True
    ErrorPolicies                : Default
    ForceHELO                    : False
    Fqdn                         :
    FrontendProxyEnabled         : False
    HomeMTA                      :
    HomeMtaServerId              :
    Identity                     : EdgeSync - MyCity to Internet
    IgnoreSTARTTLS               : False
    IsScopedConnector            : False
    IsSmtpConnector              : True
    MaxMessageSize               : 100 MB (104,857,600 bytes)
    Name                         : EdgeSync - MyCity to Internet
    Port                         : 25
    ProtocolLoggingLevel         : Verbose
    RequireOorg                  : False
    RequireTLS                   : False
    SmartHostAuthMechanism       : None
    SmartHosts                   : {}
    SmartHostsString             :
    SmtpMaxMessagesPerConnection : 20
    SourceIPAddress              : 0.0.0.0
    SourceRoutingGroup           : Exchange Routing Group (DWBGZMFD01QNBJR)
    SourceTransportServers       : {}
    TlsAuthLevel                 :
    TlsCertificateName           :
    TlsDomain                    :
    UseExternalDNSServersEnabled : False
    AddressSpaces                : {smtp:--;100}
    AuthenticationCredential     :
    CloudServicesMailEnabled     : False
    Comment                      :
    ConnectedDomains             : {}
    ConnectionInactivityTimeOut  : 00:10:00
    DNSRoutingEnabled            : False
    DomainSecureEnabled          : False
    Enabled                      : True
    ErrorPolicies                : Default
    ForceHELO                    : False
    Fqdn                         :
    FrontendProxyEnabled         : False
    HomeMTA                      :
    HomeMtaServerId              :
    Identity                     : EdgeSync - Inbound to MyCity
    IgnoreSTARTTLS               : False
    IsScopedConnector            : False
    IsSmtpConnector              : True
    MaxMessageSize               : Unlimited
    Name                         : EdgeSync - Inbound to MyCity
    Port                         : 25
    ProtocolLoggingLevel         : Verbose
    RequireOorg                  : False
    RequireTLS                   : False
    SmartHostAuthMechanism       : ExchangeServer
    SmartHosts                   : {--}
    SmartHostsString             : --
    SmtpMaxMessagesPerConnection : 20
    SourceIPAddress              : 0.0.0.0
    SourceRoutingGroup           : Exchange Routing Group (DWBGZMFD01QNBJR)
    SourceTransportServers       : {}
    TlsAuthLevel                 :
    TlsCertificateName           :
    TlsDomain                    :
    UseExternalDNSServersEnabled : False
    This is from the Hub/CAS/MBX server:
    [PS] C:\Windows\system32>Get-SendConnector | fl
    AddressSpaces                : {SMTP:*;1}
    AuthenticationCredential     :
    CloudServicesMailEnabled     : False
    Comment                      :
    ConnectedDomains             : {}
    ConnectionInactivityTimeOut  : 00:10:00
    DNSRoutingEnabled            : True
    DomainSecureEnabled          : False
    Enabled                      : False
    ErrorPolicies                : Default
    ForceHELO                    : False
    Fqdn                         : mail.va-world.com
    FrontendProxyEnabled         : False
    HomeMTA                      : Microsoft MTA
    HomeMtaServerId              : EX3
    Identity                     : outgoing SMTP
    IgnoreSTARTTLS               : False
    IsScopedConnector            : False
    IsSmtpConnector              : True
    MaxMessageSize               : 151.6 MB (158,965,760 bytes)
    Name                         : outgoing SMTP
    Port                         : 25
    ProtocolLoggingLevel         : Verbose
    RequireOorg                  : False
    RequireTLS                   : False
    SmartHostAuthMechanism       : None
    SmartHosts                   : {}
    SmartHostsString             :
    SmtpMaxMessagesPerConnection : 20
    SourceIPAddress              : 0.0.0.0
    SourceRoutingGroup           : Exchange Routing Group (DWBGZMFD01QNBJR)
    SourceTransportServers       : {EX4, EX3}
    TlsAuthLevel                 :
    TlsCertificateName           :
    TlsDomain                    :
    UseExternalDNSServersEnabled : False
    AddressSpaces                : {smtp:*;100}
    AuthenticationCredential     :
    CloudServicesMailEnabled     : False
    Comment                      :
    ConnectedDomains             : {}
    ConnectionInactivityTimeOut  : 00:10:00
    DNSRoutingEnabled            : True
    DomainSecureEnabled          : True
    Enabled                      : True
    ErrorPolicies                : Default
    ForceHELO                    : False
    Fqdn                         :
    FrontendProxyEnabled         : False
    HomeMTA                      : Microsoft MTA
    HomeMtaServerId              : Edge01
    Identity                     : EdgeSync - MyCity to Internet
    IgnoreSTARTTLS               : False
    IsScopedConnector            : False
    IsSmtpConnector              : True
    MaxMessageSize               : 100 MB (104,857,600 bytes)
    Name                         : EdgeSync - MyCity to Internet
    Port                         : 25
    ProtocolLoggingLevel         : Verbose
    RequireOorg                  : False
    RequireTLS                   : False
    SmartHostAuthMechanism       : None
    SmartHosts                   : {}
    SmartHostsString             :
    SmtpMaxMessagesPerConnection : 20
    SourceIPAddress              : 0.0.0.0
    SourceRoutingGroup           : Exchange Routing Group (DWBGZMFD01QNBJR)
    SourceTransportServers       : {Edge01}
    TlsAuthLevel                 :
    TlsCertificateName           :
    TlsDomain                    :
    UseExternalDNSServersEnabled : False
    AddressSpaces                : {smtp:--;100}
    AuthenticationCredential     :
    CloudServicesMailEnabled     : False
    Comment                      :
    ConnectedDomains             : {}
    ConnectionInactivityTimeOut  : 00:10:00
    DNSRoutingEnabled            : False
    DomainSecureEnabled          : False
    Enabled                      : True
    ErrorPolicies                : Default
    ForceHELO                    : False
    Fqdn                         :
    FrontendProxyEnabled         : False
    HomeMTA                      : Microsoft MTA
    HomeMtaServerId              : Edge01
    Identity                     : EdgeSync - Inbound to MyCity
    IgnoreSTARTTLS               : False
    IsScopedConnector            : False
    IsSmtpConnector              : True
    MaxMessageSize               : Unlimited
    Name                         : EdgeSync - Inbound to MyCity
    Port                         : 25
    ProtocolLoggingLevel         : Verbose
    RequireOorg                  : False
    RequireTLS                   : False
    SmartHostAuthMechanism       : ExchangeServer
    SmartHosts                   : {--}
    SmartHostsString             : --
    SmtpMaxMessagesPerConnection : 20
    SourceIPAddress              : 0.0.0.0
    SourceRoutingGroup           : Exchange Routing Group (DWBGZMFD01QNBJR)
    SourceTransportServers       : {Edge01}
    TlsAuthLevel                 :
    TlsCertificateName           :
    TlsDomain                    :
    UseExternalDNSServersEnabled : False
    I should note that all the Exchange servers are behind the same public IP, I just use NAT in my firewall to seperate the ports (50636 and 25 into the Edge server, 80/443 into the CAS/MBS server).

  • How to find Report Server Name

    Dear All
    Assalam-o-Alikum
    i am running the report using "run_report_object" on "Forms [32 Bit] Version 9.0.4.0.19 (Production)". the problem is that i don't know the Name of Report server, can any body can tell me that from where i find the name of report server.
    i have to give the report server name to run report.
    Thanks
    Best Regards
    Farrukh Shaikh

    hi
    u have to install the report server something like this.
    rwserver -install server=server_name autostart=yeswhen u installed the report server so u can use u r own report server name.
    and u have to use the above code in DOS.
    full path.
    c:\Developer_home\bin\rwserver -install server_name(Any Name) autostart=yes
    sarah

  • Finding Report Server Name

    Hi All,
    I am calling reports from the forms for that I have hard code the report server name in my code.
    Is there is any alternative to set the report server name dynamically at run time, means how to find the report server name and pass that into as a parameter in my code.
    Regards,
    Ashutosh

    Thanks Andreas ......... report server name is getting now.
    I have one more problem ......... i m using webutil.pll in forms 10g
    in that i am using client_host function ........ to run the host command on local machine to delete or copy a file.
    On when-button-pressed trigger writing below code :
    CLIENT_HOST('CMD /C DEL C:\TEMP.TXT');
    Its giving an error message : ORA-06503 & PL/SQL function return without value.
    Could you please help me out ....... as i am new to forms 10g
    Thanks in advance for your assistance.
    Regards
    Ashutosh

  • Finder / Shared / Server name changed

    I changed the name of one of my computers and now in the Finder / Shared list it's old name is still listed. Can I get rid of the old named server? When installing the system somehow the name got made as "MyName's-Power-Mac-G4" ..... problem with that is I have 2 other Power Macs and the name is too generic, wouldn't know which one it is without unique names.
    Thank you

    Thank you and never mind - found com.apple.sidebarlists.plist and trashed it and all's well.

  • How to find manage server name in weblogic server?

    I have two managed server in weblogic server. I need to find out which managed server serving my request. Please let me know if any body knows about this.

    You do not need to do anything, if your Report server is on the same machine as the Forms server (which is usually the case) you simply use the url as
    /reports/rwservlet?report=myreport' and the server will automatically use the default report server.
    then you simply use
    web.show_document('/reports/rwservlet?userid=scott/tiger@orcl&report=myreport&desformat=htmlcss&desname=test.html'Tony
    Try it now
    Edited by: Tony Garabedian on Nov 5, 2008 2:00 PM

  • Setting up LDAP Server to lookup Connection Factories using JNDI

    Can someone let me know how to setup LDAP server within 10G to lookup connection factories using JNDI?
    I read through the Advanced Queuing User Guide and Reference document where this is mentioned and it says use the Database Configuration Assistant to do this but I could not find how.
    When I install 10G is LDAP server automatically setup? How do I get to it?
    Thanks

    That is correct. I was indeed able to use the app server (10g) to give the LDAP user permission to access the objects, then used sql commands to register the objects inside the LDAP.
    However, I am finding NOTHING about actually creating a unique connection factory that can be registered in the LDAP. I find reference to registering Queues/Topics/Factories inside the LDAP, but nothing about actually creating the factories.
    In fact, here
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28420/aq_envir.htm#sthref409
    it's listed that you cannot use sql to create a connectionfactory... not to mention the create java commands for factories look strikingly similar to the queue/topic GET commands, and not the create commands. You can add an alias for that factory using sql, but can't actually create the factory using sql... ???

  • To Find the instance name in RMAN catalog

    Hi ,
    I have rman catalog which got registered 150 databases. Am able to get the dbname,id for the 150 databases but not able to get the server name (host name) of the correspoding databases in catalog views as well as in db views.
    Kindly revert us if you know any other analyisis or way to find the server names.
    Regards
    Krishnan

    What does RMAN care if RAC is involved or not?
    Oracle provides RMAN for backing up and restoring the database. RMAN enables you to back up, copy, restore, and recover datafiles, control files, SPFILEs, and archived redo logs. RMAN is included with the Oracle server and it is installed by default. You can run RMAN from the command line or you can use it from the Backup Manager in Oracle Enterprise Manager. The procedures for using RMAN in RAC environments do not differ substantially from those for Oracle single-instance environments. Refer to the Oracle Backup and Recovery documentation set for more information about single-instance RMAN backup procedures.

  • Renaming TFS Server name upon migration from TFS 2010 to TFS 2012

    We are migrating from TFS 2010 on existing server to TFS 2012 on new server. All components (TFS 2012, SQL 2012, SPS 2010) are directly on the new server similar to existing server (TFS 2010, SQL 2008 R2, WSS 3.0).
    The new server has a new name, however the service provider that does the actual migration,
    wants to rename
    the new server to be same name as the name of the original existing server when it is shutdown. The rename is intended to be done using
    netdom utility.
    I noticed there are articles by microsoft and others that describe various issues that may arrise as
    result of TFS server rename. However service provider still plans to rename based on his field experience and best practices.
    What do u recommend to do in this aspect ? Why would it be necessary to rename and not use the new name (DNS can map old name as well to the new IP) ? What are the actual risks in such rename and is it worth it ?
    Thank u

    Hi Cathy,
    Thank u for your reply.
    We know that renaming the new server to the same name as the original one, is
    not a must for the migration to work. The issue in question is as follows :
    1. A Microsoft partner that has hands on experience in TFS migration, and planned to migrate for us, recommends to rename the new server name, to the original server name, utilizing net_dom command, and to do it during / after  same procedure u
    provided link to.
    2. We found Microsoft documentation that cautions about renaming the server, e.g. renaming SQL server which is in our case on same machine where TFS 2012 is to be installed. However, the partner urges us to rename, explaining that net_dom should perform
    the rename safely without caution risk.
    Kindly let u sknow if Micorsoft considers such rename with net_dom to be a good
    practice in low risk for such migration,
    or better keep the new server name as it is and just map the old server name in DNS to the IP of the new server.
    Thank u.

  • Server name vs database name - confused

    Hi All,
    I am looking at the API for OracleDataSource, this is what the docs say:
    databaseName String Name of the particular database on the server. Also known as the SID in Oracle terminology.
    serverName String Name of the database server
    I know the databaseName and also can find it using select name from v$database;
    But how do I find the server name? Any file or command which can be used to find this info?
    Thanks in advance

    one server....
    SQL> select host_name servername,instance_name sid from v$instance;
    SERVERNAME SID
    hostname DB

Maybe you are looking for

  • How to get started on JavaCard 3.0 development?

    Hi, I wasn't able to attend JavaOne, but from what I understand, some lucky developers were able to write JavaCard 3.0 apps to compete in the contest that was held at JavaOne. So, how can I get started in JavaCard 3.0 app development? I can't find an

  • Why won't "my apple id" allow me to delete one of my alternate email addresses?

    I have several alternate e-mail addresses the "My Apple ID" web page, a couple of which are outdated and I want to delete.  When I click on "delete", nevertheless, they still show up.  Any ideas?

  • Mapping java TimeZones to Cities

    Hello, Does anyone know of a list where the java TimeZones have been mapped to cities in the World. I have a table with cities, and I need to insert the appropriate java TimeZone in its respective column so that I can make the date/time conversions a

  • Tables RoboHelp HTML v9

    I didn't find this topic on a quick search. So if I'm duplicating here, please point me to another post that may have the answer. Recently, I've switched/upgraded from Robo 7 to Robo 9. I had a special table format set up in Robo 7 so that I could ac

  • Which codec?

    Hi, I have an .avi file that has no audio in QT 7.1.5. No audio in DivX Player, DOES have audio in VLC. These are the audio specs: DivX 6.0, 564 x 308, Unknown ATSC A/52 and AC-3 Decoder, Stereo, 44.100 kHz I have these codecs in /Library/QuickTime: