- Home
- Skills
- APIs & Backend
- Repair DNS, Discovery & Endpoint Failures
More screenshots
Works with the AI tools you already use
Repair DNS, Discovery & Endpoint Failures
Repair DNS, Discovery & Endpoint Failures is a bounded ToolForge Labs workflow.
$8.99
Repair DNS, Discovery & Endpoint Failures
Example session with this skill installed
Our Node.js service is intermittently failing to connect to the internal database cluster after a pod restart. It seems like it's trying to hit old IP addresses. Here is our connection logic.
- Read your context and instructions
- Compiled the repair dns discovery
I have analyzed the connection logic and identified a stale endpoint caching issue within the application-level connection pool, which is ignoring the DNS TTL during pod reshuffles.
Repair for Stale Endpoint Resolution
The following fix introduces a TTL-aware resolver and forces the connection pool to refresh its internal cache when a connection is dropped or a threshold is met, ensuring it doesn't rely on OS-level caching that might be stale.
const dns = require('dns').promises;
const { Pool } = require('pg'); // Example using pg-pool
/**
* Enhanced resolver that respects TTL and handles address-family selection.
*/
class DiscoveryResolver {
constructor(hostname, ttl = 30000) {
this.hostname = hostname;
this.ttl = ttl;
this.cache = null;
this.lastLookup = 0;
}
async resolve() {
const now = Date.now();
if (this.cache && (now - this.lastLookup) < this.ttl) {
return this.cache;
}
// Resolve using address family 4 to avoid IPv6 stalls if not supported
const addresses = await dns.resolve4(this.hostname);
this.cache = addresses[Math.floor(Math.random() * addresses.length)];
this.lastLookup = now;
return this.cache;
}
}
// Invariant: Connection pool must refresh address if connection fails
const resolver = new DiscoveryResolver('db.internal.svc.cluster.local');
const pool = new Pool({
host: async () => await resolver.resolve(),
max: 20,
idleTimeoutMillis: 30000,
connectionTimeoutMillis: 2000
});
pool.on('error', (err, client) => {
console.error('Connection failure, invalidating cache');
resolver.lastLookup = 0; // Force refresh on next attempt
});
Deterministic Test Plan
| Test Case | Method | Expected Result |
|---|---|---|
| TTL Expiry | Inject Date.now mock | Resolver calls dns.resolve4 after 30s |
| Connection Error | Trigger pool.on('error') | lastLookup is reset to 0 immediately |
| Rotation | Mock multiple A records | Consecutive resolve() calls return different IPs |
Next steps
- Verify the
NDOTSsetting in yourresolv.confto ensure internal lookups aren't suffering from excessive search suffix traversals. - Check if the database client library supports dynamic host resolution; some libraries bind the IP at instantiation.
- Apply the
DiscoveryResolverpattern to your other internal microservices.
Connects securely to your tools. The creator never sees your data.
What you get
About this skill
Repair DNS, Discovery & Endpoint Failures is a bounded ToolForge Labs workflow. Repair DNS resolution, service discovery, stale endpoint caches, IPv4/IPv6 selection, endpoint rotation, and failover recovery. Works from repositories or partial logs/configuration. Produces bounded repair patterns and deterministic tests while preserving discovery policy, TTL semantics, routing boundaries, endpoint authorization, and public compatibility. It works from a full repository or partial evidence such as snippets, logs, configuration, traces, tickets, and architecture notes. The skill preserves existing product and security policy, separates verified facts from assumptions, avoids invented execution claims, and produces concrete repair or review steps with focused deterministic validation or traceable evidence.
How to install
Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.
- 1
Download the ZIP
Free skills download straight away. Paid skills unlock right after purchase.
- 2
Unzip into your skills folder
Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.
- 3
Ask your agent to use it
Restart the agent if it was already running. It picks the skill up automatically - no config needed.
Skills folder by agent
Click the path to copy it. Create the folder if it does not exist yet.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill passes our trust checks below.
Security scanned
Passed our 8-point scan before listing
Fresh listing
Recently published to Agensi
30-day refund
Not a fit? Get your money back
Trust & safety
Security scanned
Verified clean 21 days ago
- Passed all security checks, Safe to install