# exports doesn't work with hostnames (NFS)

## krisse

I'm using NFS to export some folders. I used to be able to write the hostname (as opposed to the IP address) in /etc/exports, but this no longer works.

Stopped working after a (complete) reinstall of host computer.

It's a dynamic ip address, obviously. It's correctly mapped (or however I should call it). I can ssh to hostname and whatnot, I can use "name.com" in every other scenario but NFS (exports).

```
net-fs/nfs-utils-1.1.4-r1  USE="tcpd -kerberos -nonfsv4"
```

Exports:

```
/path/to/folder name.com(ro,no_subtree_check) xxx.xxx.xx.xx(ro,no_subtree_check)
```

Why would reverse DNS not work? And why would it fail only from within NFS?

[EDIT] OpenDNS. Could that be the culprit? I'm using OpenDNS as my DNS server.

----------

## boerKrelis

Maybe NFS doesn't resolve those hostnames on every client request, but only when the exports are exported?

----------

## krisse

 *boerKrelis wrote:*   

> Maybe NFS doesn't resolve those hostnames on every client request, but only when the exports are exported?

 

You're right, hostnames are resolved only at NFS startup. However, unfortunately that's not the problem here. It persists even after a NFS restart (indeed, even after a "exportfs -ra" + NFS restart).

----------

## krisse

Hmm... Right now, it failed directly after bootup of host. (Access denied.)

Restarted NFS (and portmap) --- and then it worked just fine.

Perhaps net hasn't started before NFS, and thus it can't resolve the DNS? 

(WLAN too, so net isn't up and running immediately after service has been started.)

I'll add a depend: after net and see if that'd make a difference.

----------

## krisse

If I add a timeout (manual sleep) of ab. 20s to the nfs init script, then everything works fine.

...

Though quite a lot of other init scripts depend on nfs, so boot process hangs. 

What would be the best way to add a timeout like the above without causing hickups to the boot process? 

At first, I thought the following in /etc/conf.d/nfs might be helpful 

```
# Timeout (in seconds) for exportfs

EXPORTFS_TIMEOUT=30
```

 But it must apply to some other part, because there's no such timeout in relation to the DNS lookup.

----------

