- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Error in hostname resolution
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-24-2006 02:47 AM
тАО07-24-2006 02:47 AM
Error in hostname resolution
I have an application which takes a hostname as a parameter. My problem is that it is able to resolve hostnames, ip addresses but not "localhost". What I could guess from the output of tusc is that it is trying to resolve hostname from dns while it should have tried /etc/hosts first. My nsswitch.conf has entries like
passwd: files
group: files
hosts: files dns
services: files
networks: files
protocols: files
rpc: files
publickey: files
netgroup: files
automount: files
aliases: files
Therefore I expect it to open /usr/lib/libnss_files.1 first instead of libnss_dns.1.
Below is a snapshot of tusc trace. Any suggestions. ???
open("/etc/nsswitch.conf", O_RDONLY, 0666) ............................................................ = 5
ioctl(5, TCGETA, 0x7a0030a8) .......................................................................... ERR#25 ENOTTY
read(5, "# \n# / e t c / n s s w i t c ".., 8192) ................................................... = 401
read(5, 0x40011020, 8192) ............................................................................. = 0
close(5) .............................................................................................. = 0
open("/usr/lib/libnss_dns.1", O_RDONLY, 0) ............................................................ = 5
fstat(5, 0x7a003018) .................................................................................. = 0
read(5, "0210010e0512@ \0\0\0\0\0\0\0\0\0".., 128) .................................................... = 128
lseek(5, 128, SEEK_SET) ............................................................................... = 128
read(5, "10\0\004\0\0\0( \0\0S ec\0\010\0".., 48) ..................................................... = 48
read(5, "80\0\0\v\0\0\004\0\0\0\0", 12) ............................................................... = 12
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-24-2006 03:09 AM
тАО07-24-2006 03:09 AM
Re: Error in hostname resolution
Please run an nslookup ipaddress-server
You should see that the resolution was made by the /etc/hosts file.
If this is the case, then the problem must be with the application.
Regards,
Jaime.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-24-2006 03:14 AM
тАО07-24-2006 03:14 AM
Re: Error in hostname resolution
Yes nslookup resolves it correctly and that too using files. When I give "localhos" instead of localhost my application tries dns first and then after few steps tries files which I assume is because it was unable to resolve from dns.
Shouldn't that happen for localhost too. Somehow it is also trying to open /etc/environment file. I am not sure why is that ?????.....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-24-2006 03:18 AM
тАО07-24-2006 03:18 AM
Re: Error in hostname resolution
Make sure that you have this line in your /etc/hosts file:
127.0.0.1 localhost loopback
Regards,
Jaime.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-24-2006 03:21 AM
тАО07-24-2006 03:21 AM
Re: Error in hostname resolution
As a workaround, you should be able to create a DNS localhost entry although that more or less defeats the purpose because localhost should be able to be resolved whether or not a viable network is available.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-24-2006 03:44 AM
тАО07-24-2006 03:44 AM
Re: Error in hostname resolution
If you think this issues is resolved you can close this thread and also provide points to the people who have helped.
You have only given points to 1 out of 33 responses, hpe you understand that people spend their valuable time helping and to by assigning point it shows gratitude for their help even a 1 point is better than not assigning
Rgds
HGN
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-24-2006 05:09 PM
тАО07-24-2006 05:09 PM
Re: Error in hostname resolution
Sorry HGN. I admit my mistake. Thanks everyone for answering. but yet the issue is not resolved :-( that is why i am not closing the thread.