Strange Brouhaha

Tuesday, November 09, 2004

HP-UX Nameserver Errors

I'm posting this because I ran into a problem today, and the Internet let me down.

I admit that I'm not the smartest guy on the entire planet, especially when it comes to Unix. All of my knowledge is pretty much ad-hoc, seat-of-the-pants type stuff. If I don't use it, it kind of atrophies--the same with pretty much any skill, really. I could do with a few training classes, to be honest, but it would be 90% rehashing what I already know, which would suck.

Anyway, I was having trouble with the DNS system on my new HP-UX machine at work. Whenever I tried to run the aCC or pc compilers, or gcc for that matter, I would get this huge, shouting error message: ERROR: NAMESERVER IS DOWN! There were also some similar problems with the product I was trying to test for work. Google returned no results on the error message.

I knew the nameserver was not down. The /etc/hosts file had the correct information, uname reported correctly, hostname reported correctly. I was able to ping the machine by name. That's pretty much all you can check.

Here's where the atrophy came in. I knew, KNEW, that the problem was that the name resolver wasn't reading /etc/hosts first; rather, it was going out to check the DNS server. That's not a good thing, mainly because the system is not and will not be part of our main corporate DNS--that's IS policy, not some kind of attitude on my part. The problem was, I couldn't remember what exactly controlled that. About the only thing I did know was that resolv.conf had nothing to do with it.

Finally, in desperation, I did a really general search on Google and Google didn't disappoint this time.

If you're ever in this situation because you're dumb like me, have a look at /etc/nsswitch.conf. That file controls a whole bunch of things, including where the resolver looks for information and in what order. If the file doesn't exist, create it (I had to) and add the line "hosts: files dns" (without the quotes, obviously). If it does exist, change the "hosts" line to put "files" first.

After that, you'll be all set.

(Of course, the rev of aCC that I have doesn't work properly, but that's another story.)


  • (Matt) You said the Internet let you down, yet Google supplied you with your answer. I don't get it?

    By Anonymous Anonymous, at 8:18 AM  

  • The Internet let me down when I was searching for remedies for the error I was getting--I did a search specifically for that error, then for HP-UX nameserver errors, as well as for information on aCC, softbench, and pc. Nothing out there talked about those applications requiring DNS (and why a compiler and an IDE would want DNS is a mystery to me). If I hadn't vaguely remembered that there was a way to specify which resource to search first, I'd have been out of luck.

    The funny thing is, the version of aCC that I have is nowhere NEAR as good as the same-vintage version of gcc. So it was pretty much all for nothing.

    By Blogger Robert, at 9:23 AM  

Post a Comment

<< Home