Operating System - HP-UX
1820879 Members
5327 Online
109628 Solutions
New Discussion юеВ

NFS Server/Client - exportfs error: x: unknown host

 
Glenn L. Stewart
Frequent Advisor

NFS Server/Client - exportfs error: x: unknown host

A mysterious one just to keep you all on your toes.
This one has been buggin me for a few hours now...

I was able to emulate this problem on another box, so I'll give you the minimum need to create the problem. The reason for such evades me, but I am sure many of you will have an answer.

Promblem Box name: devdb1
Symptom:
in /etc/rc.log -
Output from "/sbin/rc2.d/S430nfs.client start"
exportfs error: devapp1: unknown host
exportfs error: devapp2: unknown host
exportfs error: devapp1: unknown host
exportfs error: devapp2: unknown host
exportfs error: prddb0e2.ampol.com.au: unknown host

These hosts exist in both /etc/hosts and DNS
/etc/hosts entry is alias and not full name

NFS is set to both Client and Server in /etc/nfsconf
This error does not occur if Server is set to 0 (obviously).

/etc/exports has
/sapmnt/DEV/exe -anon=65534,root=devapp1:devapp2,access=devapp1:devapp2

/etc/nsswitch.conf has DNS before files

To debug I put a test nslookup in S430nfs.client of the host emulating the problem.
The result was:

/usr/bin/nslookup devapp1
*** Can't find server name for address 203.0.34.97: Timed out
*** Can't find server name for address 203.0.34.34: Timed out
*** Can't find server name for address 203.0.34.33: Timed out
*** Default servers are not available
Using /etc/hosts on: devdb3

looking up FILES
Name: devapp1.sydho.ampol.com.au
Address: 203.0.34.97
Aliases: devapp1

Of course it must be noted that resolv.conf contains:
search sydho.ampol.com.au ampol.com.au
nameserver 203.0.34.97
nameserver 203.0.34.34
nameserver 203.0.34.33

Note that this problem only occurs during starting. Mounting is not a problem after box is up.

exportfs would normally use /etc/hosts. Reading the man page, one could assume that DNS is not used.
I believe this might be related to the nsslookup failing.
Please note also that after the box is up, nslookup is fine.


Thanks
5 REPLIES 5
Steven Sim Kok Leong
Honored Contributor

Re: NFS Server/Client - exportfs error: x: unknown host

Hi,

There is an issue with aliases in /etc/hosts. If you are using the alias in your /etc/exports file, put it before your the qualified name in your /etc/hosts file.

Hope this helps. Regards.

Steven Sim
Brainbench MVP for Unix Admin
http://www.brainbench.com
Dan Hetzel
Honored Contributor

Re: NFS Server/Client - exportfs error: x: unknown host

Hi Glenn,

Did you try wit FILES before DNS in /etc/nsswitch.conf ?
like in:
hosts: files [TRYAGAIN=continue NOTFOUND=continue] dns

Dan
Everybody knows at least one thing worth sharing -- mailto:dan.hetzel@wildcroft.com
Glenn L. Stewart
Frequent Advisor

Re: NFS Server/Client - exportfs error: x: unknown host

Ended up that having the correct order in /etc/hosts solved the problem.
I still cannot understand why nslookup would fail during this section of startup.

I only wonder what would happen on a box with a limited /etc/hosts file. How many people reply on DNS over /etc/hosts these days given that a few DNS servers are much easier to maintain than an individual /etc/hosts file for each box. I have 18 HP boxes, so I don't have a very large updating task but....

I will try reversing the order of files/DNS in nsswitch.conf too.
Volker Borowski
Honored Contributor

Re: NFS Server/Client - exportfs error: x: unknown host

Hello Glenn,
just a matter of interest. May be there is something wrong in the sequence of your network initialisation ?
I.e. static routes to your nameserver are set up after your try to mount the nfs-drives ? (Yes most unlikely...)
Or (most likely) you use some dynamic routing which needs its time to rip around for some minutes to finaly reach your dns-server. In this case you might need to implement some delay before mounting the filesystems ?
Just an idea.
Volker
Rob Mallard
Valued Contributor

Re: NFS Server/Client - exportfs error: x: unknown host

nslookup needs to be able to do a reserve lookup on the dns servers in your /etc/resolv.conf

You may want to enusre your resevrse lookup is configured.