To enable name resolution, you need to configure your HP-UX system to use DNS servers. Once it will be enabled then all the configured name resolutions will be done through the DNS Server.
- If you will try to nslookup for onlinesbi.com without configuring the DNS then it will read the domain from /etc/hosts file and give the below result:
# nslookup onlinesbi.com Name Server: ns1.indianrail.gov.in Address: 203.176.113.82 Trying DNS Non-authoritative answer: Name: onlinesbi.com Address: 223.31.160.61
- If the information in /etc/hosts will not be available then it will give the below result:
# nslookup onlinesbi.com Name Server: ns1.indianrail.gov.in Address: 203.176.113.82 Trying DNS looking up FILES Non-authoritative answer: Name: onlinesbi.com Address: 223.31.160.61
Here I have shown how to add a DNS server on an HP-UX server
Configuration of /etc/resolv.conf
resolv.conf is the name of a computer file used in various operating systems to configure the system’s Domain Name System (DNS) resolver. The file is a plain-text file usually created by the network administrator or by applications that manage the configuration tasks of the system.
- Log in as a super/root user on the server.
- Edit the /etc/resolv.conf file and if the file is not available then create it.
# vi /etc/resolv.conf
- Add the DNS servers as nameservers in the /etc/resolv.conf file, as shown below. Here we have added the two DNS servers 203.176.113.82 and 203.176.113.84. After adding the server details, save the file.
. . search onlinesbi.com www.onlinesbi.com merchant.onlinesbi.com sbiepay.com www.sbiepay.com nameserver 203.176.113.82 nameserver 203.176.113.84 nameserver 127.0.0.1 . .
Configuration of /etc/nsswitch.conf
The Name Service Switch (NSS) is a facility in Unix-like operating systems that provides a variety of sources for common configuration databases and name resolution mechanisms. These sources include local operating system files (such as /etc/passwd, /etc/group, and /etc/hosts), the Domain Name System (DNS), the Network Information Service (NIS), and LDAP.
- Log in as a super/root user on the server.
- Edit the /etc/nsswitch.conf file, as shown below
# vi /etc/nsswitch.conf
- Add the DNS corresponding to the files which you need to resolve through DNS. Here I configured the resolution of hosts name only through DNS. Save the file.
. . passwd: files group: files hosts: dns files . .
Name resolution through DNS Server
- You have added the DNS server on this machine now all the hosts name resolutions will be done through the DNS servers.
- nslookup for onlinesbi.com, resolved by DNS server 203.176.113.82
# nslookup onlinesbi.com Name Server: ns1.indianrail.gov.in Address: 203.176.113.82 Trying DNS Non-authoritative answer: Name: onlinesbi.com Address: 223.31.160.61
Note: I have done the above configuration on an HP-UX 11.31 machine.
Last Updated: September 08, 2018
Related Posts
- How to Find NIC (Network Interface Card) Details in HP-UX
- How to Install a .depot Package Using swinstall on HP-UX
- HP-UX: How to restrict NFS share access to a particular server?
- crontab: you are not authorized to use cron. Sorry. in HP-UX
- HP-UX: SSH taking too much time after adding the DNS Servers
- How to add DNS servers on an HP-UX server
- How to login to vPar console in HP-UX
- How to extend the size of Logical Volume (LV) in HP-UX
- How to determine file system type in HP-UX using command
- How to check vPar machines status in HP-UX
- How to find HBA cards/ports and WWN Number details in HP-UX (nPar)
- How to find HBA cards/ports and WWN Number details in HP-UX (vPar)
- HP-UX command to get Physical Memory Information
- HP-UX command to get Processor Information
- HP-UX command to get Hardware Serial Number
- su: Sorry in HP-UX while switching from normal user to root user
- SSH login taking too much time on HP-UX 11.31
- How to Disable Root SHH Login in HP-UX?
- hpvmstatus: HPVM currently not running.
- How to view/print routing table in HP-UX?
- Create a Logical Volume larger than 2TB and format it in HP-UX
- Protect SSH Logins with SSH and MOTD Banner Messages in HP-UX
- Remove welcome message after login in HP-UX 11.31
- Create a Logical Volume and format it in HP-UX
- How to rescan new LUNs added in HP-UX 11.31
- How to reboot a HP-UX machine?
- How to remove File System, LV and VG in HP-UX and Linux?
- How to remove NO_HW devices from ioscan in HP-UX without a reboot?
- Change root user password of vpar machine in HP-UX