# Unbound DNS delay

## grant123

I run unbound for DNS on my Gentoo laptop (which also acts as the network router) and my wife does the same.  Mine always works right away but there is a long delay of at least a couple minutes before her's starts working after a reboot or if she doesn't use it for a bit.  Any idea what could be causing that?  I'd prefer to have her system run unbound instead of querying my system for DNS.

----------

## khayyam

grant123 ...

the ubound version, useflags, and unbound.conf would probably be a good start.

```
# emerge -pvq unbound

# egrep -v '(^.*#|^$) /etc/unbound/unbound.conf
```

best ... khay

----------

## grant123

Hi Khay!  I should also mention that there is no such delay when we're traveling.  It only happens when we're on the road at which time I normally USB tether to an Android phone for connectivity.

```
# emerge -pvq unbound

[ebuild   R   ] net-dns/unbound-1.5.1-r2  USE="ecdsa -debug -dnstap -gost -python (-selinux) -static-libs {-test} -threads" ABI_X86="32 (64) (-x32)" PYTHON_TARGETS="python2_7"
```

```
# egrep -v '(^.*#|^$)' /etc/unbound/unbound.conf

server:

   verbosity: 1

   

   

   

   

   

   

   

python:

remote-control:
```

Missed a ' in the egrep line before.   :Smile: 

----------

## khayyam

 *grant123 wrote:*   

> Hi Khay!  I should also mention that there is no such delay when we're traveling.  It only happens when we're on the road at which time I normally USB tether to an Android phone for connectivity.

 

hey grant ... that makes it very difficult to debug ;) ... and didn't you say it was only your wifes install that was effected? Anyhow, as you have nothing defined in unbound.conf, I'm going to suggest you try a couple of things (most of which is pure speculation as there isn't much to go on).

1). try adding 'options edns0' to resolv.conf ... you can do this via /etc/conf.d/net like so:

```
dns_servers_<interface>="127.0.0.1"

dns_options_<interface>="edns0"
```

1.1) I would also disable ipv6 if it's currently enabled:

```
enable_ipv6_<interface>="false"
```

You might also disable ipv6 in the kernel, or prevent the modules loading via /etc/modprobe.d/blacklist.conf ... if you're not using it, that is.

2). Try adding the 'threads' useflag, and adding 'num-threads: <number of cores>' to unbound.conf

3). Try adding a 'root-hints:' file (in fact this, I think, is required for normal operation). 

```
# wget ftp://ftp.internic.net/domain/named.cache -O /etc/unbound/named.cache
```

```
root-hints: "/etc/unbound/named.cache"
```

3). tune 'outgoing range:', I'm not sure what the OS will support but something like '$((1024/<number of cores> - 50))' would be the optimal (with threads).

There is a howto optimise guide on the unbound site that, though targeting a server, provides some suggestions are to what other parameters you might tune.

HTH & best ... khay

----------

## grant123

First of all, I mistyped the following:

 *Quote:*   

> I should also mention that there is no such delay when we're traveling.

 

That should have been:

 *Quote:*   

> I should also mention that there is only a delay when we're traveling.

 

The issue never happens at home, only when we're traveling.  It only happens to my wife's system which is connected to my system.  My system acts as the router at home and when we're traveling.  We both run unbound.

SOLVED!

I looked more closely and DNS actually does work on her system at all times but a domain name ping doesn't come back (but does resolve) while an IP ping does come back.  When I noticed that I remembered a special MTU setting my wife's system has that mine doesn't and the rest is history.  :Smile:   Thank you for helping me figure this out Khay!

----------

