8.4.5 Configuring Easy Connect Naming to Use a DNS Alias

You can optionally configure a DNS alias for the host name, as provided with the host naming method.

With host naming, clients use a connect string that uses the following pattern:

CONNECT username@DNS_alias
Enter password: password

The following procedure describes how to configure a DNS alias:

  1. Ensure the database service is registered with the listener.

    If the database can find the listener, then information about the database service is dynamically registered with the listener during service registration, including the service name. The listener is found if the following conditions are met:

    • The default listener named LISTENER on TCP/IP, port 1521 is running.

    • The LOCAL_LISTENER parameter is set in the initialization file.

    If the database cannot find the listener, then you can configure static registration for the listener.

  2. Establish a host name resolution environment.

    You can configure a mechanism such as DNS, NIS, or a centrally-maintained TCP/IP host file, /etc/hosts. For example, if a service name of sales.us.example.com for a database exists on a computer named sales-server, then the entry in the /etc/hosts file would look like the following:

    #IP address of server     host name       alias
    192.0.2.35              sales-server    sales.us.example.com
    

    The domain section of the service name must match the network domain.

  3. Connect to the database using the DNS alias.

    Using the example in the previous step, the client can use sales.example.com in the connect string:

    CONNECT username@sales.us.example.com
    Enter password: password
    

    If the client and server are in the same domain such as us.example.com, then the client must enter only sales in the connect string.