Gitlab excessive DNS requests

Problem

When I inspect my DNS logs I see that gitlab is constantly requesting DNS results. A little over 1 second and never stops. It just got a whole lot worse in version 11.

This is happening when not a single user is connected via browser or doing and git activity. I mean absolutely NO ACTIVITY FROM USERS AT ALL.

This is extremely bad behaviour. No other system/application I have on the network is this poorly behaved when idle.

If however you connect to the UI. There is no appreciable increase while a user is connected. So this is all back ground NON-SENSE. For no reason what so ever.

How do I stop this?

Close this.

This has to do with systemd and it’s horrible resolver.

I fixed this by changing the file /etc/nsswitch.conf

Configured line:

host:          files dns

Changed to:

hosts:          files resolve [!UNAVAIL=return] dns

Note: If you run a local DNS you will most likely have to change /etc/resolv.conf to use it instead of the local one.

Typo.

With a systemd system the everything defaults to a in built resolver. Which is basically broken.

You probably should create a new resolv.conf and add your own nameserver and search entries.