Looping module stopped

Hi Bruce,

Unbound is primarily a caching server, and even though it does support local zones, that is not its main purpose. Bind (and other dns servers) allows a server to be both recursive and authoritative, but it is not really a clean way of operating (IMHO).

If you want a public server, it should only expose public authoritative information. Internally, you should separate recursive and authoritative services, using unbound only as a recursive server, using a stub zone to refer to internal authoritative information, which could be in an internal view on the same server as the public authoritative information. If you only have a handful of RRs for the internal zone, you could use unbound's local zone, but I think it would be more convenient to manage all the authoritative data in one location, rather than two.

If you have to run them on the same server, you should make unbound only respond to an internal interface; the authoritative server should only respond to an external interface, using the internal view if a request comes from the server host itself.

Just my two cents,

Jan

Hi,

Offlist, Bruce found a solution, it was do turn off do-ip6 in the
unbound.conf. Ip6 was turned off in RHEL as well. For some reason the
ipv6 sockets took an inordinate amount of effort.

(I would like people to run with ipv6 enabled of course, but this seems
interesting when you deploy on kernels with ipv6 disabled).

Best regards,
   Wouter

Generally at the worst case we have three views. I'll pass this on. Thanks

Bruce

Bruce Hayward, MTS Allstream Inc., (p) 204-958-1983 (e) bruce.hayward@mtsallstream.com

Offlist, Bruce found a solution, it was do turn off do-ip6 in the
unbound.conf. Ip6 was turned off in RHEL as well. For some reason the
ipv6 sockets took an inordinate amount of effort.

Are you going to investigate this further?

(I would like people to run with ipv6 enabled of course, but this seems
interesting when you deploy on kernels with ipv6 disabled).

Can we pass an option to unbound to override the config setting? And perhaps
only pass it when we find NETWORKING_IPV6=yes in /etc/sysconfig/network via
the init script?

Worst case, we could check for the option and warn on bootup. But ideally it
should run fast either way.

Paul

I'll send off some verbosity = 4, and some configs later - just caught
up with testing

Bruce

Bruce Hayward, MTS Allstream Inc., (p) 204-958-1983 (e)
bruce.hayward@mtsallstream.com

A little elaboration:

Outside of Unbound:

I had added the following lines to /etc/modprobe.conf:
alias net-pf-10 off
options ipv6 disable=1
I also changed /etc/sysconfig/network to read:
NETWORKING_IPV6=no

To disable ipv6 when installing RHEL 5.5 (on a Dell 2970)

In the unbound.conf file I left the 'do-ip6: yes' commented out <which yes is the default>

We also run an anycast model - which is running two virtual (static) IPs of off eth1. These IPs are the same IPs as are used in servers in several cities - so your lookups are geo based with the same IPs.

Hence I have 'interface-automatic: yes' set to yes.
And the interfaces are explicitely set (all of them - the loopback, the physical and the two virtuals) as opposed to using 0.0.0.0 - seems to be what works.

This configs ended up dropping QPS to 160 - 2000 at a high end.

Setting 'do-ip6: no' changed the QPS to between 45,000 and 60,000 pending the cache.

We will be going to IPV6 shortly, but not just now.

Bruce

Bruce Hayward, MTS Allstream Inc., (p) 204-958-1983 (e) bruce.hayward@mtsallstream.com

Guys,

RHEL 5 + IPv6 = evil

Bruce, could it be that you have ip6tables turned on? The IPv6 and ip6tables implementations in the kernel shipped with RHEL 5 are riddled with bugs. One of these bugs is that if you enable ip6tables, even without any firewall rules, the MTU size drops dramatically and the kernel mucks up IPv6 fragmentation.

I've written down some of the problems we ran into on our resolvers (running unbound on both IPv4 as well as IPv6) in this blogpost (it also contains some info on compiling a newer BIND on RHEL 5.x, but you can ignore that):

https://dnssec.surfnet.nl/?p=464

Cheers,

-- Roland M. van Rijswijk
-- SURFnet Middleware Services
-- t: +31-30-2305388
-- e: roland.vanrijswijk@surfnet.nl

Hi

Iptables(6) is not an issue. Thanks 8o)

Bruce

Bruce Hayward, MTS Allstream Inc., (p) 204-958-1983 (e)
bruce.hayward@mtsallstream.com

Hi

I been hammering my way through this.

The tool that I have on the RHEL servers is iptables (not something that we normally use)

I have figured out enough to know that I cannot use port forwarding as this is to localhost. But must use thee port redirect option E.g.
iptables -t nat -A PREROUTING -p tcp -d 142.161.130.xxx --dport 53 -j REDIRECT --to-ports 49152
iptables -t nat -A PREROUTING -p udp -d 142.161.130.xxx --dport 53 -j REDIRECT --to-ports 49152

Means if 142.161.130.xxx will connect at port 53 of this server then it will actually connected to 49152

And in the unbound.conf file I have setup
  interface: 142.161.130.xxy@49152
        interface: 142.161.130.xxx@49152
        interface: 127.0.0.1@53
        interface: 127.0.0.1@49152

When I do a netstat -na|grep -i listen - I do not see the port 49152 listening.

What am I missing?

Bruce

Bruce Hayward, MTS Allstream Inc., (p) 204-958-1983 (e) bruce.hayward@mtsallstream.com

Hi

I been hammering my way through this.

The tool that I have on the RHEL servers is iptables (not something that we normally use)

I have figured out enough to know that I cannot use port forwarding as this is to localhost. But must use thee port redirect option E.g.
iptables -t nat -A PREROUTING -p tcp -d 142.161.130.xxx --dport 53 -j REDIRECT --to-ports 49152
iptables -t nat -A PREROUTING -p udp -d 142.161.130.xxx --dport 53 -j REDIRECT --to-ports 49152

Means if 142.161.130.xxx will connect at port 53 of this server then it will actually connected to 49152

I think you need -s 142... and not -d 142... here. -s is source
address, -d is destination address.

And in the unbound.conf file I have setup
interface: 142.161.130.xxy@49152
interface: 142.161.130.xxx@49152
interface: 127.0.0.1@53
interface: 127.0.0.1@49152

When I do a netstat -na|grep -i listen - I do not see the port 49152 listening.

What am I missing?

-l switch to nestat.

Hi

Would then:

iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 53 -j REDIRECT --to-port 49152

regardless of IP address direct any ip hitting port 53 to redirect to port 49152?

Also do not see the port showing up with the netstat regardless of options - does unbound not open that port when configured?

Thanks

Bruce

Bruce Hayward, MTS Allstream Inc., (p) 204-958-1983 (e) bruce.hayward@mtsallstream.com

Hi,

Hi

Would then:

iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 53 -j REDIRECT --to-port 49152

I think so, but it's a long time since I had to use iptables.

regardless of IP address direct any ip hitting port 53 to redirect to port 49152?

Also do not see the port showing up with the netstat regardless of options - does unbound not open that port when configured?

Try: netstat -tnlp and -unlp and if the port doesn't show up then
check the logs. (Well check the log file anyway as a first thing when
something doesn't work as expected...)

root@ookami:~# netstat -tnlp | grep unbound
tcp 0 0 127.0.0.1:53 0.0.0.0:*
LISTEN 1715/unbound
tcp 0 0 127.0.0.1:953 0.0.0.0:*
LISTEN 1715/unbound
tcp6 0 0 ::1:53 :::*
LISTEN 1715/unbound
tcp6 0 0 ::1:953 :::*
LISTEN 1715/unbound
root@ookami:~# netstat -anlp | grep unbound
tcp 0 0 127.0.0.1:53 0.0.0.0:*
LISTEN 1715/unbound
tcp 0 0 127.0.0.1:953 0.0.0.0:*
LISTEN 1715/unbound
tcp6 0 0 ::1:53 :::*
LISTEN 1715/unbound
tcp6 0 0 ::1:953 :::*
LISTEN 1715/unbound
udp 0 0 127.0.0.1:53 0.0.0.0:*
         1715/unbound
udp6 0 0 ::1:53 :::*
         1715/unbound
unix 3 [ ] STREAM CONNECTED 9599 1715/unbound
unix 3 [ ] STREAM CONNECTED 9598 1715/unbound
unix 2 [ ] DGRAM 9586 1715/unbound

Before I spend more on this (I even have Iptables firewall logs running as well as the usual assortment)

Is there someone out there that has configured an interface in the unbound.conf to a port other than 53? (something in the private/dynamic range)

Per the unbound.conf man:
interface: <ip address[@port]>

and sees it listening (netstat -na|grep -I listen or netstat -tnlp | grep unbound or netstat -anlp | grep unbound)

?

Thanks

Bruce

Bruce Hayward, MTS Allstream Inc., (p) 204-958-1983 (e) bruce.hayward@mtsallstream.com

Hi Bruce,

I have configured a test server at Men & Mice with:
interface: 10.99.99.1@9000

and output of netstat -na | grep 9000

tcp 0 0 10.99.99.1:9000 0.0.0.0:* LISTEN
udp 0 0 10.99.99.1:9000 0.0.0.0:*

Notice that UDP ports never display the “LISTEN” state as the TCP ports are.

and sees it listening (netstat -na|grep -I listen or netstat -tnlp | grep unbound or netstat -anlp | grep unbound)

I can’t quite see from your command there below, but in your grep command is using a -i switch (lower case i for case-insensitive).

Hope this helps!

Best regards
Arni.

Arni Birgisson
Professional Services
Men & Mice
Address: Noatun 17, IS-105, Reykjavik, Iceland
Phone: +354-412-1500
Email: arnib@menandmice.com
www.menandmice.com

Men & Mice
We bring control and flexibility to network management

Disclaimer: www.menandmice.com/disclaimer

# interface: 192.0.2.154@5003

        # interface: 2001:DB8::5

        interface: 142.161.130.152@49152

        interface: 142.161.130.131@49152

# interface: 142.161.2.131

        interface: 127.0.0.1@53

        interface: 127.0.0.1@49152

        # enable this feature to copy the source address of queries to reply.

        # Socket options are not supported on all platforms. experimental.

        interface-automatic: yes

        # port to answer queries from

# port: 53

[root@wnpgmb02hbv-ns09 etc]# netstat -na |grep 49152

[root@wnpgmb02hbv-ns09 etc]#

Bruce

Bruce Hayward, MTS Allstream Inc., (p) 204-958-1983 (e) bruce.hayward@mtsallstream.com <mailto:bruce.hayward@mtsallstream.com>

What I have:

# interface: 192.0.2.154@5003

        # interface: 2001:DB8::5

        interface: 142.161.130.152@49152

        interface: 142.161.130.131@49152

# interface: 142.161.2.131

        interface: 127.0.0.1@53

        interface: 127.0.0.1@49152

        # enable this feature to copy the source address of queries to
reply.

        # Socket options are not supported on all platforms.
experimental.

        interface-automatic: yes

        # port to answer queries from

# port: 53

What I see:

[root@wnpgmb02hbv-ns09 etc]# netstat -na |grep 49152

[root@wnpgmb02hbv-ns09 etc]#

sigh

8o)

Bruce

Bruce Hayward, MTS Allstream Inc., (p) 204-958-1983 (e)
bruce.hayward@mtsallstream.com <mailto:bruce.hayward@mtsallstream.com>

(attachments)

homecoming_with_no_top_100_email_signature.gif

Zitat von "Hayward, Bruce" <Bruce.Hayward@mtsallstream.com>:

What I have:

# interface: 192.0.2.154@5003

        # interface: 2001:DB8::5

        interface: 142.161.130.152@49152

        interface: 142.161.130.131@49152

# interface: 142.161.2.131

        interface: 127.0.0.1@53

        interface: 127.0.0.1@49152

        # enable this feature to copy the source address of queries to
reply.

        # Socket options are not supported on all platforms.
experimental.

        interface-automatic: yes

        # port to answer queries from

# port: 53

What I see:

[root@wnpgmb02hbv-ns09 etc]# netstat -na |grep 49152

[root@wnpgmb02hbv-ns09 etc]#

Maybe a limitation/setting of the OS? Have you tried something lower than port 32768?
Works fine here BTW with Unbound 1.4.6....

Regards

Andreas

Just tried that for you...

# netstat -tnlp | grep unbound
tcp 0 0 127.0.0.1:953 0.0.0.0:*
LISTEN 3078/unbound
tcp 0 0 127.0.0.1:49152 0.0.0.0:*
LISTEN 3078/unbound
tcp6 0 0 ::1:953 :::*
LISTEN 3078/unbound

Hi all

If you enable:
interface-automatic: yes
then any interface ports other than 53 disappear (when using interface: <ip address[@port]> as per the documentation).

We have interface-automatic: yes enabled as suggested as we run in an anycast model (same virtuals regardless of geo).

Thoughts on how to accomplish both (views and anycast) given the behaviour of ports on the <ip address[@port]> line teamed with interface-automatic.

Much Thanks

Bruce

Bruce Hayward, MTS Allstream Inc., (p) 204-958-1983 (e) bruce.hayward@mtsallstream.com

Hi All

I have setup some virtual interfaces, using private (192.168..) IPs and using IPTables to forward the incoming traffic to them.

Likewise these private interfaces do not show when configured in the unbound.conf on the interface line (netstat -tnlp | grep unbound) if we turn on Interface-automatic: yes.

I rebuilt the 'Public' virtual IPs to dangle off of the physical interface (eth1), instead of the loopback.

Testing is going well with 'Interface-automatic: yes' turned off, with the new virtual interfaces running private IPs, and the Public Virtuals moved from the loopback to an ethx virtual.

The next phase will be creating another instance of unbound running at the same time (just will create another config directory, and use the same binary), and get it to discriminate between the two versions running, based upon the private IP listened to.

If all of this works, then we have 'views'.

Bruce

Bruce Hayward, MTS Allstream Inc., (p) 204-958-1983 (e) bruce.hayward@mtsallstream.com