{"id":13840798,"url":"https://github.com/lixiangzhong/dnsutil","last_synced_at":"2026-02-26T22:34:37.395Z","repository":{"id":41211592,"uuid":"58504417","full_name":"lixiangzhong/dnsutil","owner":"lixiangzhong","description":" dns dig for golang","archived":false,"fork":false,"pushed_at":"2024-02-28T01:33:24.000Z","size":1192,"stargazers_count":101,"open_issues_count":1,"forks_count":40,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-08-13T19:06:52.783Z","etag":null,"topics":["dig","dns","dns-dig","go","golang","golang-library","golang-package"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lixiangzhong.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-05-11T01:23:31.000Z","updated_at":"2025-06-03T12:41:56.000Z","dependencies_parsed_at":"2024-04-12T14:11:57.636Z","dependency_job_id":"5f5ba00c-3341-4543-9cf6-f5498da0adf5","html_url":"https://github.com/lixiangzhong/dnsutil","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/lixiangzhong/dnsutil","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lixiangzhong%2Fdnsutil","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lixiangzhong%2Fdnsutil/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lixiangzhong%2Fdnsutil/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lixiangzhong%2Fdnsutil/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lixiangzhong","download_url":"https://codeload.github.com/lixiangzhong/dnsutil/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lixiangzhong%2Fdnsutil/sbom","scorecard":{"id":594493,"data":{"date":"2025-08-11","repo":{"name":"github.com/lixiangzhong/dnsutil","commit":"aeec0c407fd637a7b48276d8c6f57106d9efa919"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":1,"reason":"Found 4/21 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 13 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T22:48:24.535Z","repository_id":41211592,"created_at":"2025-08-20T22:48:24.535Z","updated_at":"2025-08-20T22:48:24.535Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29874580,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-26T21:05:00.265Z","status":"ssl_error","status_checked_at":"2026-02-26T20:57:13.669Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dig","dns","dns-dig","go","golang","golang-library","golang-package"],"created_at":"2024-08-04T17:00:55.905Z","updated_at":"2026-02-26T22:34:37.371Z","avatar_url":"https://github.com/lixiangzhong.png","language":"Go","funding_links":[],"categories":["Go","Go (531)"],"sub_categories":[],"readme":"[![Go Report Card](https://goreportcard.com/badge/github.com/lixiangzhong/dnsutil)](https://goreportcard.com/report/lixiangzhong/dnsutil)\n[![](https://godoc.org/github.com/lixiangzhong/dnsutil?status.svg)](https://godoc.org/github.com/lixiangzhong/dnsutil)\n\n# dnsutil\n#### Golang DNS  dig功能库\n\n```sh\ngo get github.com/lixiangzhong/dnsutil\n```\n\n\n```go\n//Normal\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/lixiangzhong/dnsutil\"\n)\n\nfunc main() {\n    var dig dnsutil.Dig \n    dig.SetDNS(\"8.8.8.8\") //or ns.xxx.com \n    a, err := dig.A(\"google.com\")  // dig google.com @8.8.8.8\n    fmt.Println(a, err)\n}\n```\n\n```go\n//msg\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/lixiangzhong/dnsutil\"\n\t\"github.com/miekg/dns\"\n)\n\nfunc main() {\n\tvar dig dnsutil.Dig\n\tdig.SetDNS(\"1.1.1.1\")\n\tmsg, err := dig.GetMsg(dns.TypeA, \"google.com\")\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\t// fmt.Println(msg)\n\t// or\n\tfmt.Println(msg.Question) //question section\n\tfmt.Println(msg.Answer)   //answer section.\n\tfmt.Println(msg.Ns)       //authority section.\n\tfmt.Println(msg.Extra)    //additional section.\n}\n\n```\n\n\n```go\n//EDNS0ClientSubnet\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/lixiangzhong/dnsutil\"\n)\n\nfunc main() {\n    var dig dnsutil.Dig\n    dig.SetDNS(\"8.8.8.8\") //or ns.xxx.com\n    dig.SetEDNS0ClientSubnet(\"123.123.123.123\")   //support edns0clientsubnet\n    a, err := dig.A(\"google.com\")  // dig google.com @8.8.8.8 +client=123.123.123.123\n    fmt.Println(a, err)\n}\n```\n\n\n```go\n//Retry\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/lixiangzhong/dnsutil\"\n)\n\nfunc main() {\n    var dig dnsutil.Dig\n    dig.Retry=3 //retry  when write or read message return error . defualt 1\n    dig.SetDNS(\"8.8.8.8\") //or ns.xxx.com \n    a, err := dig.A(\"google.com\")  // dig google.com @8.8.8.8\n    fmt.Println(a, err)\n}\n```\n\n\n```go\n//dig +trace\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/lixiangzhong/dnsutil\"\n)\n\nfunc main() {\n\tdomain := \"google.com\"\n\tvar dig dnsutil.Dig\n\trsps, err := dig.Trace(domain)  //dig +trace google.com\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\tfor _, rsp := range rsps {\n\t\tif rsp.Msg.Authoritative {\n\t\t\tfor _, answer := range rsp.Msg.Answer {\n\t\t\t\tfmt.Println(answer)\n\t\t\t}\n\t\t}\n\t\tfor _, ns := range rsp.Msg.Ns {\n\t\t\tfmt.Println(ns)\n\t\t}\n\t\tfmt.Println(\"\\tReceived from\", rsp.Server, rsp.ServerIP)\n\t}\n}\n```\n\n\n```go\n//检查是否被污染\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/lixiangzhong/dnsutil\"\n)\n\nfunc main() {\n\tpolluted, err := dnsutil.IsPolluted(\"facebook.com\")\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\tif polluted {\n\t\tfmt.Println(\"被污染,你懂的\")\n\t} else {\n\t\tfmt.Println(\"正常\")\n\t}\n}\n```\n\n\n```go\n//SetBackupDNS\n//同时向设置的2个DNS发起请求,返回最快响应的那个结果\n//Initiate requests to two DNS settings at the same time, returning the fastest response result\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/lixiangzhong/dnsutil\"\n)\n\nfunc main() {\n\tvar dig dnsutil.Dig\n\tdig.SetDNS(\"1.1.1.1\")\n\tdig.SetBackupDNS(\"8.8.8.8\")\n\ta, err := dig.A(\"google.com\")\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\tfmt.Println(a)\n}\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flixiangzhong%2Fdnsutil","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flixiangzhong%2Fdnsutil","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flixiangzhong%2Fdnsutil/lists"}