
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
A TypeScript DNS server library.
npm install
import {
UdpServer,
RequestHandler,
RecordType,
RecordClass,
ResourceRecord,
createARecord,
ResponseCode,
} from 'dnsts';
// Create a request handler
const handler = new RequestHandler();
// Handle A record queries
handler.onA((question) => {
if (question.name === 'example.com') {
const answer: ResourceRecord = {
name: question.name,
type: RecordType.A,
class: RecordClass.IN,
ttl: 300,
rdata: createARecord('93.184.216.34'),
};
return { answers: [answer] };
}
return { rcode: ResponseCode.NXDOMAIN };
});
// Create and start the server
const server = new UdpServer({
port: 53,
handler,
});
server.start();
# Start the example server
npm run example
# In another terminal, test with dig
dig @127.0.0.1 -p 5353 example.com A
dig @127.0.0.1 -p 5353 hello.local TXT
The RequestHandler class routes DNS queries to appropriate handlers:
const handler = new RequestHandler();
// Type-specific handlers
handler.onA(callback); // A records
handler.onAAAA(callback); // AAAA records
handler.onCNAME(callback); // CNAME records
handler.onMX(callback); // MX records
handler.onTXT(callback); // TXT records
handler.onNS(callback); // NS records
handler.onANY(callback); // ANY queries
// Generic handlers
handler.on(RecordType.SOA, callback); // Any record type
handler.onDefault(callback); // Fallback handler
handler.onAll(callback); // Wildcard (receives all queries)
type QueryHandler = (
question: Question,
message: Message,
clientInfo: ClientInfo
) => Promise<HandlerResult> | HandlerResult;
interface HandlerResult {
answers?: ResourceRecord[];
authorities?: ResourceRecord[];
additionals?: ResourceRecord[];
rcode?: ResponseCode;
}
Helper functions to create record data:
import {
createARecord,
createAAAARecord,
createNameRecord, // For CNAME, NS, PTR
createMXRecord,
createTXTRecord,
} from 'dnsts';
createARecord('192.168.1.1');
createAAAARecord('2001:db8::1');
createNameRecord('ns1.example.com');
createMXRecord(10, 'mail.example.com');
createTXTRecord(['v=spf1 include:example.com ~all']);
src/
├── protocol/ # DNS protocol implementation
│ ├── types.ts # Type definitions
│ ├── name.ts # Domain name encoding/decoding
│ ├── header.ts # DNS header parsing
│ ├── question.ts # Question section
│ ├── record.ts # Resource records
│ └── message.ts # Complete DNS messages
├── server/ # Server implementations
│ ├── udp.ts # UDP server
│ ├── tcp.ts # TCP server
│ └── handler.ts # Request routing
└── index.ts # Main exports
MIT
FAQs
A TypeScript DNS server library
We found that dnsts demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.