 |
|
Resolving host names with DNS for Oracle
Don Burleson
|
With Oracle, the tnsnames.ora file allows you to
connect directly to a database using the TNS "service name".
When an Oracle connection is requested, Oracle goes to the
tnsnames.ora file and looks-up the service name entry in the
tnsnames.ora file and gets:
1 - The host server name
2 - The protocol
3 - The port to use to connect to the server
But how does Oracle resolve the host name to an
IP address. In UNIX, special lookup files exist that pair the
host name with the IP address. Termed "Domain Name Services"
(DNS), the DNS is especially useful because when a server changes an
IP address, you only need to make the change in one place on the
server and all host name connections will immediately find the new IP
address.
Host name to IP address
resolution files
UNIX |
/etc/hosts |
Windows NT/2000/XP Pro |
c:\winnt\system32\drivers\etc\hosts or hosts.sam |
Windows XP |
c:\windows\system32\drivers\etc\hosts or hosts.sam |
In UNIX we vi the /etc/hosts file. In
Windows we open the hosts.sam file using Notepad.
Dynamic DNS resolution on
UNIX/Linux
The /etc/hosts file contains
the IP address, host name resolutions:
299.211.182.27 chicago
199.21.3.3 toyoko
To use DNS on UNX/Linux, you need to
ensure that the server is configured for DNS:
1. the /etc/host.conf should have the line:
order hosts,bind
2 - The /etc/nsswitch.conf should
have this line:
hosts: files nisplus nis dns
Dynamic DNS resolution on
Windows
In Windows XP we use DHCP, Dynamic Host
Configuration Protocol and this must be enables to use automatic host
name resolution.
DHCP Configuration for Windows XP:
- Right click on "My Network Places" icon on your desktop or go to
the "Start Menu", select "Control Panel", then select "Network
Connections"
- Within the "Network Connection" window, double click on "Local
Network Connection"
- Select "Properties"
- Select "Internet Protocol (TCP/IP)" within the connection items
- Click on the "Properties" button.
- Under the General tab, select "Obtain IP address automatically"
and "Obtain DNS server address automatically"
|