{"id":31221017,"url":"https://github.com/linkdata/dnsjson","last_synced_at":"2025-09-21T19:12:00.373Z","repository":{"id":315392820,"uuid":"1059278278","full_name":"linkdata/dnsjson","owner":"linkdata","description":null,"archived":false,"fork":false,"pushed_at":"2025-09-18T11:33:17.000Z","size":53,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-18T11:34:07.578Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/linkdata.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-18T08:29:35.000Z","updated_at":"2025-09-18T11:32:26.000Z","dependencies_parsed_at":"2025-09-18T20:31:25.424Z","dependency_job_id":null,"html_url":"https://github.com/linkdata/dnsjson","commit_stats":null,"previous_names":["linkdata/dnsjson"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/linkdata/dnsjson","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkdata%2Fdnsjson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkdata%2Fdnsjson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkdata%2Fdnsjson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkdata%2Fdnsjson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linkdata","download_url":"https://codeload.github.com/linkdata/dnsjson/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkdata%2Fdnsjson/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276191284,"owners_count":25600411,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-21T02:00:07.055Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-09-21T19:11:54.792Z","updated_at":"2025-09-21T19:11:59.289Z","avatar_url":"https://github.com/linkdata.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![build](https://github.com/linkdata/dnsjson/actions/workflows/build.yml/badge.svg)](https://github.com/linkdata/dnsjson/actions/workflows/build.yml)\n[![coverage](https://github.com/linkdata/dnsjson/blob/coverage/main/badge.svg)](https://htmlpreview.github.io/?https://github.com/linkdata/dnsjson/blob/coverage/main/report.html)\n[![goreport](https://goreportcard.com/badge/github.com/linkdata/dnsjson)](https://goreportcard.com/report/github.com/linkdata/dnsjson)\n[![Docs](https://godoc.org/github.com/linkdata/dnsjson?status.svg)](https://godoc.org/github.com/linkdata/dnsjson)\n\n# dnsjson\n\nJSON (un)marshalling for https://github.com/miekg/dns\n\nThis is not [RFC 8427](https://www.rfc-editor.org/rfc/rfc8427.html), rather it is a structured human-readable format.\n\n```go\npackage main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\n\t\"github.com/linkdata/dnsjson\"\n\t\"github.com/miekg/dns\"\n)\n\nfunc main() {\n\tmsg := new(dns.Msg)\n\tmsg.SetQuestion(\"example.com.\", dns.TypeA)\n\tmsg.Id = 1234\n\tjbytes, err := json.MarshalIndent((*dnsjson.Msg)(msg), \"\", \" \")\n\tif err == nil {\n\t\tfmt.Println(string(jbytes))\n\t\tvar msg2 dnsjson.Msg\n\t\tif err = json.Unmarshal(jbytes, \u0026msg2); err == nil {\n\t\t\tfmt.Println(dns.Msg(msg2).Question[0].Name)\n\t\t}\n\t}\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\n\t// Output:\n\t// {\n\t//  \"id\": 1234,\n\t//  \"msgHdr\": {\n\t//   \"opcode\": \"QUERY\",\n\t//   \"rd\": true,\n\t//   \"rcode\": \"NOERROR\"\n\t//  },\n\t//  \"question\": [\n\t//   {\n\t//    \"name\": \"example.com.\",\n\t//    \"qtype\": \"A\",\n\t//    \"qclass\": \"IN\"\n\t//   }\n\t//  ]\n\t// }\n\t// example.com.\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkdata%2Fdnsjson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinkdata%2Fdnsjson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkdata%2Fdnsjson/lists"}