Total Pageviews

Saturday, 6 July 2019

dns解析服务器程序-dnsserver

Simple DNS Server implemented in Go

The Domain Name System (DNS) consists of multiple elements: Authoritative DNS Servers store and provide DNS record information, Recursive DNS servers (also referred to as caching DNS servers) are the "middlemen" that recursively look up information on behalf of an end-user. See Authoritative vs. Recursive DNS Servers: What's The Difference for an overview.
This project provides a subset of the functionality of an Authoritative DNS Server as a study project. If you need a production-grade DNS Server in Go, have a look at CoreDNS. For DNS library support, see Go DNS or package dnsmessage.
Featured on r/golang and go-nuts.
Simple DNS Server implemented in Go

Run

$ go run dnsserver.go &
Listening at:  :1053

$ dig example.com @localhost -p 1053
Received request from  [::1]:63282

; <<>> DiG 9.10.6 <<>> example.com @localhost -p 1053
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- 0="" 17060="" 17:02:43="" 17="" 1="" 2019="" 3.1.3.7="" 31337="" 56="" ::1="" a="" additional:="" answer:="" answer="" authority:="" cest="" code="" example.com.="" flags:="" id:="" in="" jun="" mon="" msec="" msg="" noerror="" opcode:="" qr="" query:="" query="" question="" rcvd:="" section:="" server:="" size="" status:="" time:="" when:="">

Concepts

No comments:

Post a Comment