The only agent that thinks for itself

Autonomous Monitoring with self-learning AI built-in, operating independently across your entire stack.

Unlimited Metrics & Logs
Machine learning & MCP
5% CPU, 150MB RAM
3GB disk, >1 year retention
800+ integrations, zero config
Dashboards, alerts out of the box
> Discover Netdata Agents

Centralized metrics streaming and storage

Aggregate metrics from multiple agents into centralized Parent nodes for unified monitoring across your infrastructure.

Stream from unlimited agents
Long-term data retention
High availability clustering
Data replication & backup
Scalable architecture
Enterprise-grade security
> Learn about Parents

Fully managed cloud platform

Access your monitoring data from anywhere with our SaaS platform. No infrastructure to manage, automatic updates, and global availability.

Zero infrastructure management
99.9% uptime SLA
Global data centers
Automatic updates & patches
Enterprise SSO & RBAC
SOC2 & ISO certified
> Explore Netdata Cloud

Deploy Netdata Cloud in your infrastructure

Run the full Netdata Cloud platform on-premises for complete data sovereignty and compliance with your security policies.

Complete data sovereignty
Air-gapped deployment
Custom compliance controls
Private network integration
Dedicated support team
Kubernetes & Docker support
> Learn about Cloud On-Premises

Powerful, intuitive monitoring interface

Modern, responsive UI built for real-time troubleshooting with customizable dashboards and advanced visualization capabilities.

Real-time chart updates
Customizable dashboards
Dark & light themes
Advanced filtering & search
Responsive on all devices
Collaboration features
> Explore Netdata UI

Monitor on the go

Native iOS and Android apps bring full monitoring capabilities to your mobile device with real-time alerts and notifications.

iOS & Android apps
Push notifications
Touch-optimized interface
Offline data access
Biometric authentication
Widget support
> Download apps

The future of infrastructure observability

See our strategic direction across AI-native observability, full-stack signals, operational intelligence, and enterprise platform maturity.

AI-native observability
Full-stack signal coverage
Operational intelligence
Enterprise platform maturity
Agent releases every 6 weeks
Cloud continuous delivery
> Explore Product Roadmap

Best energy efficiency

True real-time per-second

100% automated zero config

Centralized observability

Multi-year retention

High availability built-in

Zero maintenance

Always up-to-date

Enterprise security

Complete data control

Air-gap ready

Compliance certified

Millisecond responsiveness

Infinite zoom & pan

Works on any device

Native performance

Instant alerts

Monitor anywhere

AI-native observability

Continuous delivery

Open source foundation

80% Faster Incident Resolution

AI-powered troubleshooting from detection, to root cause and blast radius identification, to reporting.

True Real-Time and Simple, even at Scale

Linearly and infinitely scalable full-stack observability, that can be deployed even mid-crisis.

90% Cost Reduction, Full Fidelity

Instead of centralizing the data, Netdata distributes the code, eliminating pipelines and complexity.

See and Map Your Entire Network

Live topology, flow analytics, and SNMP device and trap monitoring — unified with your full-stack observability.

Control Without Surrender

SOC 2 Type 2 certified with every metric kept on your infrastructure.

Integrations

800+ collectors and notification channels, auto-discovered and ready out of the box.

800+ data collectors
Auto-discovery & zero config
Cloud, infra, app protocols
Notifications out of the box
> Explore integrations
Real Results
46% Cost Reduction

Reduced monitoring costs by 46% while cutting staff overhead by 67%.

— Leonardo Antunez, Codyas

Zero Pipeline

No data shipping. No central storage costs. Query at the edge.

From Our Users
"Out-of-the-Box"

So many out-of-the-box features! I mostly don't have to develop anything.

— Simon Beginn, LANCOM Systems

No Query Language

Point-and-click troubleshooting. No PromQL, no LogQL, no learning curve.

Enterprise Ready
67% Less Staff, 46% Cost Cut

Enterprise efficiency without enterprise complexity—real ROI from day one.

— Leonardo Antunez, Codyas

SOC 2 Type 2 Certified

Zero data egress. Only metadata reaches the cloud. Your metrics stay on your infrastructure.

Full Coverage
800+ Collectors

Auto-discovered and configured. No manual setup required.

Any Notification Channel

Slack, PagerDuty, Teams, email, webhooks—all built-in.

Built for the People Who Get Paged

Because 3am alerts deserve instant answers, not hour-long hunts.

Every Industry Has Rules. We Master Them.

See how healthcare, finance, and government teams cut monitoring costs 90% while staying audit-ready.

Monitor Any Technology. Configure Nothing.

Install the agent. It already knows your stack.
From Our Users
"A Rare Unicorn"

Netdata gives more than you invest in it. A rare unicorn that obeys the Pareto rule.

— Eduard Porquet Mateu, TMB Barcelona

99% Downtime Reduction

Reduced website downtime by 99% and cloud bill by 30% using Netdata alerts.

— Falkland Islands Government

Real Savings
30% Cloud Cost Reduction

Optimized resource allocation based on Netdata alerts cut cloud spending by 30%.

— Falkland Islands Government

46% Cost Cut

Reduced monitoring staff by 67% while cutting operational costs by 46%.

— Codyas

Real Coverage
"Plugin for Everything"

Netdata has agent capacity or a plugin for everything, including Windows and Kubernetes.

— Eduard Porquet Mateu, TMB Barcelona

"Out-of-the-Box"

So many out-of-the-box features! I mostly don't have to develop anything.

— Simon Beginn, LANCOM Systems

Real Speed
Troubleshooting in 30 Seconds

From 2-3 minutes to 30 seconds—instant visibility into any node issue.

— Matthew Artist, Nodecraft

20% Downtime Reduction

20% less downtime and 40% budget optimization from out-of-the-box monitoring.

— Simon Beginn, LANCOM Systems

Pay per Node. Unlimited Everything Else.

One price per node. Unlimited metrics, logs, users, and retention. No per-GB surprises.

Free tier—forever
No metric limits or caps
Retention you control
Cancel anytime
> See pricing plans

What's Your Monitoring Really Costing You?

Most teams overpay by 40-60%. Let's find out why.

Expose hidden metric charges
Calculate tool consolidation
Customers report 30-67% savings
Results in under 60 seconds
> See what you're really paying

Your Infrastructure Is Unique. Let's Talk.

Because monitoring 10 nodes is different from monitoring 10,000.

On-prem & air-gapped deployment
Volume pricing & agreements
Architecture review for your scale
Compliance & security support
> Start a conversation

Monitoring That Sells Itself

Deploy in minutes. Impress clients in hours. Earn recurring revenue for years.

30-second live demos close deals
Zero config = zero support burden
Competitive margins & deal protection
Response in 48 hours
> Apply to partner

Per-Second Metrics at Homelab Prices

Same engine, same dashboards, same ML. Just priced for tinkerers.

Community: Free forever · 5 nodes · non-commercial
Homelab: $90/yr · unlimited nodes · fair usage
> Get the Homelab Plan

$1,000 Per Referral. Unlimited Referrals.

Your colleagues get 10% off. You get 10% commission. Everyone wins.

10% of subscriptions, up to $1,000 each
Track earnings inside Netdata Cloud
PayPal/Venmo payouts in 3-4 weeks
No caps, no complexity
> Get your referral link
Cost Proof
40% Budget Optimization

"Netdata's significant positive impact" — LANCOM Systems

Calculate Your Savings

Compare vs Datadog, Grafana, Dynatrace

Savings Proof
46% Cost Reduction

"Cut costs by 46%, staff by 67%" — Codyas

30% Cloud Bill Savings

"Reduced cloud bill by 30%" — Falkland Islands Gov

Enterprise Proof
"Better Than Combined Alternatives"

"Better observability with Netdata than combining other tools." — TMB Barcelona

Real Engineers, <24h Response

DPA, SLAs, on-prem, volume pricing

Why Partners Win
Demo Live Infrastructure

One command, 30 seconds, real data—no sandbox needed

Zero Tickets, High Margins

Auto-config + per-node pricing = predictable profit

Homelab Ready
Free Video Course

8-episode Netdata tutorial by LearnLinux.tv

76k+ GitHub Stars

3rd most starred monitoring project

Worth Recommending
Product That Delivers

Customers report 40-67% cost cuts, 99% downtime reduction

Zero Risk to Your Rep

Free tier lets them try before they buy

AI Support Assistant, Available 24/7

Nedi has access to all official documentation, source code, and resources. Ask any question about Netdata—responds in your language.

Deployment & configuration
Troubleshooting & sizing
Alerts & notifications
Evidence-based answers
> Ask Nedi now

Never Fight Fires Alone

Docs, community, and expert help—pick your path to resolution.

Learn.netdata.cloud docs
Discord, Forums, GitHub
Premium support available
> Get answers now

60 Seconds to First Dashboard

One command to install. Zero config. 850+ integrations documented.

Linux, Windows, K8s, Docker
Auto-discovers your stack
> Read our documentation

76,000+ Engineers Strong

615+ contributors. 1.5M daily downloads. One mission: simplify observability.

Per-Second. 90% Cheaper. Data Stays Home.

Side-by-side comparisons: costs, real-time granularity, and data sovereignty for every major tool.

See why teams switch from Datadog, Prometheus, Grafana, and more.

> Browse all comparisons
Edge-Native Observability, Born Open Source
Per-second visibility, ML on every metric, and data that never leaves your infrastructure.
Founded in 2016
615+ contributors worldwide
Remote-first, engineering-driven
Open source first
> Read our story
Promises We Publish—and Prove
12 principles backed by open code, independent validation, and measurable outcomes.
Open source, peer-reviewed
Zero config, instant value
Data sovereignty by design
Aligned pricing, no surprises
> See all 12 principles
Edge-Native, AI-Ready, 100% Open
76k+ stars. Full ML, AI, and automation—GPLv3+, not premium add-ons.
76,000+ GitHub stars
GPLv3+ licensed forever
ML on every metric, included
Zero vendor lock-in
> Explore our open source
Build Real-Time Observability for the World
Remote-first team shipping per-second monitoring with ML on every metric.
Remote-first, fully distributed
Open source (76k+ stars)
Challenging technical problems
Your code on millions of systems
> See open roles
Meet the Team Behind Netdata
Conferences, meetups, and tradeshows where you can see Netdata in action and talk to the engineers who build it.
Live demos and deep dives
Book 1-on-1 meetings
Talks and panel sessions
Event recaps and photos
> See all events
Talk to a Netdata Human in <24 Hours
Sales, partnerships, press, or professional services—real engineers, fast answers.
Discuss your observability needs
Pricing and volume discounts
Partnership opportunities
Media and press inquiries
> Book a conversation
Your Data. Your Rules.
On-prem data, cloud control plane, transparent terms.
Trust & Scale
76,000+ GitHub Stars

One of the most popular open-source monitoring projects

SOC 2 Type 2 Certified

Enterprise-grade security and compliance

Data Sovereignty

Your metrics stay on your infrastructure

Validated
University of Amsterdam

"Most energy-efficient monitoring solution" — ICSOC 2023, peer-reviewed

ADASTEC (Autonomous Driving)

"Doesn't miss alerts—mission-critical trust for safety software"

Community Stats
615+ Contributors

Global community improving monitoring for everyone

1.5M+ Downloads/Day

Trusted by teams worldwide

GPLv3+ Licensed

Free forever, fully open source agent

Why Join?
Remote-First

Work from anywhere, async-friendly culture

Impact at Scale

Your work helps millions of systems

$ guides / pgbouncer / pgbouncer-server-dns-lookup-failed ▌

Operations Guides

PgBouncer server DNS lookup failed: stale cache and failed failover

You see server DNS lookup failed in the PgBouncer log, usually right after a PostgreSQL failover, a DNS change, or a network event. New server connections cannot be established. Depending on timing, you may instead see the nastier variant: no error at all, just a pool quietly draining because PgBouncer’s DNS cache still points at the old primary IP.

PgBouncer maintains its own DNS cache, independent of the TTL your DNS records publish. The cache lifetime is controlled by dns_max_ttl (default: 15 seconds). After a failover, up to dns_max_ttl can pass before PgBouncer even becomes eligible to re-resolve the backend hostname. Cached results are only re-queried when a new server connection is needed, so existing connections to the old IP keep running (against a dead or read-only host) while nothing forces a fresh lookup.

This article covers how to confirm the stale-cache condition, how to force recovery, and how to tune DNS behavior so the next failover does not page you.

What this means

PgBouncer resolves backend hostnames asynchronously and caches the result. Two failure modes follow:

  1. Lookup fails outright. The resolver returns an error or NXDOMAIN. PgBouncer logs server DNS lookup failed and cannot create new server connections. DNS errors and NXDOMAIN results are themselves cached for dns_nxdomain_ttl (default: 15 seconds), so a transient resolver hiccup suppresses retries for that window.
  2. Lookup succeeds but returns the stale IP. The cache still holds the pre-failover address. New connections go to the old primary, which is dead, refusing connections, or demoted to standby and read-only. Applications see connection failures or read-only transaction errors. Connections established before the failover may keep working briefly, which masks the problem while the pool drains.

The second mode is the classic “failed failover” pattern: the database layer failed over correctly, but the pooler did not follow. PgBouncer has no health-based backend routing. It connects wherever the cached DNS answer says.

When a hostname’s resolution does change, existing server connections using the old address are closed as they are released back to the pool (timing depends on pooling mode), and new connections use the new address. Nothing force-closes active connections mid-transaction. RECONNECT (added in PgBouncer 1.9) and a connection-changing RELOAD mark the affected connections for replacement.

flowchart TD
  A[PostgreSQL failover - IP changes] --> B[DNS record updated]
  B --> C{PgBouncer DNS cache}
  C -->|stale entry within dns_max_ttl| D[old IP returned]
  C -->|lookup fails| E[server DNS lookup failed in log]
  D --> F[new connections hit dead or read-only host]
  E --> G[no new server connections]
  F --> H[pool drains, sv_idle falls]
  G --> H
  H --> I[cl_waiting grows until query_wait_timeout]
  J[connection-changing RELOAD or RECONNECT] --> K[connections marked for replacement, then re-established]
  K --> C

Common causes

CauseWhat it looks likeFirst thing to check
Stale cache after failoverFailover completed, but SHOW DNS_HOSTS still shows the old IP; new connections fail or go read-onlySHOW DNS_HOSTS resolved addresses vs current DNS answer
DNS resolver unreachable or slowserver DNS lookup failed in log, dns_queries in SHOW LISTS stays above zeroTest resolution from the PgBouncer host with the same resolver PgBouncer uses
NXDOMAIN or error cachedA transient resolver failure got cached for dns_nxdomain_ttl, blocking retriesSHOW DNS_HOSTS; wait out or flush the cache
dns_max_ttl too high for your failover RTOEvery failover takes up to dns_max_ttl plus connection drain time to recoverSHOW CONFIG for dns_max_ttl
Hostname config driftBackend configured by hostname where you expected an IP, or an /etc/hosts entry that was not updated after failoverThe [databases] section of pgbouncer.ini and /etc/hosts
AAAA lookup problemsPgBouncer requests both A and AAAA records; some DNS backends error on AAAA (for example when IPv6 is disabled), failing the whole lookupTest both A and AAAA queries for the backend hostname against the same resolver

Quick checks

All checks run against the PgBouncer admin console and are read-only unless noted.

# See what IP PgBouncer has cached for each backend hostname,
# and how many seconds until the entry is eligible for re-query
psql -h 127.0.0.1 -p 6432 -U pgbouncer pgbouncer -c "SHOW DNS_HOSTS;"

# Compare against the current DNS answer from the same host
getent hosts pg-primary.example.com
# or
dig +short pg-primary.example.com

# Check whether DNS queries are stuck in flight
psql -h 127.0.0.1 -p 6432 -U pgbouncer pgbouncer -Atc "SHOW LISTS;" | grep dns

# Check pool state: is the pool draining?
# Falling sv_idle + rising sv_login + growing cl_waiting = connections not being replaced
psql -h 127.0.0.1 -p 6432 -U pgbouncer pgbouncer -c "SHOW POOLS;"

# Confirm the TTL and resolver config PgBouncer is running with
psql -h 127.0.0.1 -p 6432 -U pgbouncer pgbouncer -Atc "SHOW CONFIG;" | grep -i dns

# Look for the error and related connection failures in the log
grep -E "server DNS lookup failed|connect failed|login failed" /var/log/pgbouncer/pgbouncer.log | tail -30

Key things in SHOW DNS_HOSTS output: the resolved addresses per hostname, and the TTL column (seconds until the entry is eligible for re-lookup). If the address shown there does not match what dig returns from the same host, you have confirmed the stale-cache condition.

How to diagnose it

  1. Confirm the symptom class. Grep the log for server DNS lookup failed. If present, resolution itself is failing. If absent but applications report connection errors or read-only errors after a failover, suspect the stale-IP variant instead.
  2. Read the cache. Run SHOW DNS_HOSTS. Write down the resolved address for each backend hostname.
  3. Read reality. Resolve the same hostname from the PgBouncer host (dig +short, getent hosts). Use the resolver PgBouncer is configured to use, not just the system default, if resolv_conf points elsewhere.
  4. Compare. If the cached IP differs from live DNS, the cache is stale. If live DNS itself still returns the old IP, the problem is upstream of PgBouncer: the failover tooling did not update DNS, or the record TTL at your DNS layer is the bottleneck.
  5. Check pool impact. Run SHOW POOLS. The signature of a DNS-blocked pool is total server connections declining over time (sv_idle falling, sv_login stuck or failing) while cl_waiting and maxwait grow. Distinguish this from ordinary pool exhaustion, where total connections stay pinned at pool_size. See PgBouncer backend unreachable: PostgreSQL down and the pool draining for the broader pattern.
  6. Check for in-flight queries. SHOW LISTS and look at dns_queries. Consistently non-zero means the resolver is slow or unreachable, not just that the cache is stale.
  7. Check both address families. If your DNS backend errors on AAAA queries, test explicitly: dig AAAA <hostname> @<resolver>. An AAAA error can fail the entire lookup even when the A record is fine.

Metrics and signals to monitor

SignalWhy it mattersWarning sign
SHOW DNS_HOSTS resolved addressesGround truth for where PgBouncer will connectCached IP does not match live DNS after a topology change
dns_queries (SHOW LISTS)In-flight DNS lookups; resolver health proxySustained above zero
sv_login (SHOW POOLS)Connections stuck or failing during backend establishmentPersistently above zero with low sv_active
Total server connections per poolA draining pool means connections die without replacementsv_active + sv_idle + sv_used declining over minutes
cl_waiting and maxwait (SHOW POOLS)User-facing impact once the pool can no longer serve requestscl_waiting > 0 sustained, maxwait climbing toward query_wait_timeout (default 120s)
Log: server DNS lookup failed, connect failedThe only direct error signal; PgBouncer has no error counters in SHOW commandsAny occurrence during or after a failover

Fixes

Wait out the TTL

If dns_max_ttl is at its 15-second default and the failover just happened, the cache entry expires on its own and the next needed server connection triggers a fresh lookup. Acceptable only if your RTO tolerates the wait plus connection drain time. The TTL expiring only makes the entry eligible for re-query. The actual re-query happens when a new server connection is needed, and existing connections to the old IP are closed as they are released, not immediately.

RELOAD to flush the DNS cache

# Disruptive: re-reads config and re-resolves all hostnames
psql -h 127.0.0.1 -p 6432 -U pgbouncer pgbouncer -c "RELOAD;"

RELOAD re-reads the configuration and updates changeable settings. It does not provide a general DNS-cache flush. When a database definition’s connection parameters change, it marks that database’s existing server connections close_needed, and new connections use the changed settings; if the config is unchanged, the cache remains governed by its TTL. RELOAD also re-processes the full config. Before 1.24.0 it recycled TLS connections, causing a noticeable reconnect wave; 1.24.0 made that recycling conditional on a TLS-settings change.

RECONNECT to force new server connections

# Disruptive: closes all server connections for the database
# after they finish their current transaction
psql -h 127.0.0.1 -p 6432 -U pgbouncer pgbouncer -c "RECONNECT mydb;"
# or all databases
psql -h 127.0.0.1 -p 6432 -U pgbouncer pgbouncer -c "RECONNECT;"

RECONNECT (available since PgBouncer 1.9) closes server connections as they finish their current transaction and makes replacements. Use it after the cache has expired or after a connection-changing RELOAD, when long-lived connections are still pinned to the old IP. In session pooling mode, connections are held for the whole client session, so drain time depends on client behavior. Expect a brief latency bump as new connections authenticate.

Fix the resolver path

If the lookup itself is failing rather than returning stale data: verify the resolver PgBouncer uses is reachable, check resolv_conf if you point PgBouncer at a non-default resolver file, and test AAAA behavior if your DNS backend is picky. A cached NXDOMAIN clears after dns_nxdomain_ttl (default 15s), or after a reload that changes the affected database definition; RELOAD is not a general DNS-cache flush.

Prevention

  • Set dns_max_ttl deliberately. The 15-second default is reasonable for many setups, but if your failover mechanism is DNS-based, align dns_max_ttl with your RTO. Lower values speed failover at the cost of more resolver load, which is usually trivial for a handful of backend hostnames.
  • Consider dns_zone_check_period. When set (default: 0, disabled), PgBouncer polls the SOA serial of the zone it derives from the configured hostname and re-queries those hostnames when the serial changes, giving faster pickup than TTL expiry alone. It requires the c-ares DNS backend. Verify in your DNS service that its SOA serial changes on record updates and that SOA queries are permitted; do not assume operator-controlled serial behavior on managed DNS.
  • Runbook the recovery commands. Failover automation should include a connection-changing RELOAD or targeted RECONNECT against PgBouncer as a post-promotion step, so recovery does not depend on someone remembering the cache exists.
  • Prefer IPs or local resolution where DNS adds no value. If a backend address is effectively static, configuring an IP (or a managed /etc/hosts entry) bypasses the cache entirely. You trade failover flexibility for one less moving part.
  • Test the failover path end to end. The database failover working is not the same as the pooled path recovering. Drill it: promote a replica, watch SHOW DNS_HOSTS, measure time-to-recovery through PgBouncer.
  • Watch the signals, not just the log. Alert on draining pool totals plus rising cl_waiting during known failover windows, and check paused/disabled state before escalating, since maintenance produces lookalike symptoms.

How Netdata helps

  • Netdata collects PgBouncer pool state (cl_waiting, maxwait, sv_active, sv_idle, sv_login) at per-second granularity, so the drain pattern of a stale-DNS event is visible as it develops, not after query_wait_timeout starts firing.
  • Per-pool breakdowns show whether the problem is isolated to one (database, user) pool or hitting every backend, which separates a single stale hostname from a resolver-wide failure.
  • Correlating sv_login against total server connections distinguishes “connections failing to establish” (DNS or backend problem) from “pool saturated but healthy” (ordinary exhaustion), the two most commonly confused PgBouncer incidents.
  • High-resolution maxwait history tells you how close waiters came to query_wait_timeout during the event, which informs whether your dns_max_ttl and failover runbook actually meet your RTO.
  • Log-based signals like server DNS lookup failed have no SHOW-command counter, so pairing PgBouncer metrics with host-level log monitoring closes the error-visibility gap.