Skip to content

ReursorAuth scope /0 problem #16803

@mglants

Description

@mglants
  • Program: Recursor
  • Issue type: Bug report

Short description

I have recursor --> pdns auth(with views enabled)
ClientIP is passed via EDNS
The problem is first request from 127.0.0.1 for domain is cached, and if client for different View (internal) 10.0.0.0/8 is asking for record Recursor responds with cached request for wrong view

Recursor config

  incoming:
    listen:
      - 0.0.0.0
    port: 54
    allow_from:
      - 0.0.0.0/0
    use_incoming_edns_subnet: true
  recordcache:
    max_ttl: 86400
    max_negative_ttl: 10
  packetcache:
    disable: true
  outgoing:
    edns_subnet_allow_list:
      - 0.0.0.0/0
  ecs:
    add_for:
      - 0.0.0.0/0
    ipv4_cache_bits: 24
    ipv4_bits: 24 

Auth Config

  cache-ttl: "0"
  negquery-cache-ttl: "0"
  query-cache-ttl: "0"
  views: "yes"
  zone-cache-refresh-interval: "300"
  edns-subnet-processing: "yes"

Environment

  • Operating system: Ubuntu 22.04 LTS
  • Software version: PowerDNS 5.0.2, Recursor 5.3.4
  • Software source: PowerDNS repository

Steps to reproduce

  1. Create zone example.com
  2. Create view for example.com_internal - subnet 10.0.0.0/8
  3. Create record test.example.com - A 10.0.0.1 for default zone view (0.0.0.0/0)
  4. Create record test.example.com A 10.0.0.2 for _internal zone view (10.0.0.0/8)

Expected behaviour

  1. Ask record for test.example.com from 127.0.0.1 - getting 10.0.0.1 as expected
  2. Ask record for test.example.com from 10.14.0.1 - getting 10.0.0.2 as expected

Actual behaviour

  1. Ask record for test.example.com from 127.0.0.1 - getting 10.0.0.1 as expected
  2. Ask record for test.example.com from 10.14.0.1 - getting 10.0.0.1 (cached) should answer 10.0.0.2
  3. Cache expires ask test.example.com from 10.14.0.1 - getting 10.0.0.2 as expected
  4. Ask record for test.example.com from 127.0.0.1 - getting 10.0.0.1 as expected... becase it first got not /0 scope

Other information

If i ask PDNS Auth directly - it answers as expected
I think the problem is PDNS Auth returns CLIENT-SUBNET for default view as scope /0, so Recursor cache it and answer for all clients
tried ipv4_never_cache still cache default view if first answered

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions