I’m binding a FreeNAS box to AD for student logins to SMB mounts. That all works fine.

I have a bash script that runs on the FreeNAS to build an index.html page pointing to a subdirectory of each student’s home directory, where they can put finished coding projects on the web for public view. That works too.

The script does an AD lookup for each user on the FreeNAS, and only adds them to the index.html file if they are a student (ie, member of the `CN=students` group):

```
ldapsearch -Q -LLL cn=[someuser] ObjectCategory:CN=Person memberOf 

```

Here’s the weird part. About 80% of the time, the AD lookup happens instantly. Every fifth lookup, it takes 75 seconds to complete. I’ve written a script to test this and the pattern is quite reproducible. Almost invariably, every 5th lookup takes exactly 75 seconds, and it doesn’t matter if you look up the same name 5 times or different ones. 

If I do an `ldapsearch` immediately in the command line:

```
ldapsearch -LLL cn=someuser

```

and I do it repeatedly, every 5th repetition it's slow. If I abort the slow query by hitting `Ctrl`-`C`, the next time I do it it's fast again.

I don’t run the AD server, and the AD admin doesn’t know why this would be happening. Any clues? 

DNS is configured correctly both ways AFAIK -- or at least, everything else about the setup seems to work (users can log into the FreeNAS using AD credentials, and that happens reasonably fast). All clocks are in sync too.