Skip to content

DNS responses are cached #135888

@zhenyavinogradov

Description

@zhenyavinogradov

According to #89274, NixOS uses nscd only for dispatching nss modules, and caching functionality of nscd is disabled by default. But when I run any application that resolves the same DNS name in a loop on a clean NixOS system, I observe that DNS packets are not sent on each request, they are only sent after ttl elapses. It means that other requests are served from some local cache. Only if I stop nscd service I see the packets being sent on each request.

A simple script to reproduce this: while true; do getent ahosts github.com; sleep 1; done

Is there some component other than nscd that does this caching, or does nscd itself needs some extra configuration to actually disable caching?

cc @flokli

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bugSomething is broken6.topic: nixosIssues or PRs affecting NixOS modules, or package usability issues specific to NixOS

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions