{"id":14956099,"url":"https://github.com/ipfs/go-dnslink","last_synced_at":"2025-10-01T16:31:53.617Z","repository":{"id":2933948,"uuid":"47923632","full_name":"ipfs/go-dnslink","owner":"ipfs","description":"dnslink resolution in go-ipfs","archived":false,"fork":false,"pushed_at":"2024-10-10T08:17:07.000Z","size":49,"stargazers_count":55,"open_issues_count":7,"forks_count":17,"subscribers_count":24,"default_branch":"master","last_synced_at":"2025-01-14T11:56:28.578Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/ipfs.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":"2015-12-13T15:00:31.000Z","updated_at":"2024-08-26T10:27:42.000Z","dependencies_parsed_at":"2024-03-21T15:57:29.309Z","dependency_job_id":"2ec0e2a8-7535-4e16-9d88-5478ccf87793","html_url":"https://github.com/ipfs/go-dnslink","commit_stats":{"total_commits":35,"total_committers":12,"mean_commits":"2.9166666666666665","dds":0.7142857142857143,"last_synced_commit":"f97efbd6b51dcbe4c682278c3dd56ebe9b49da08"},"previous_names":["jbenet/go-dnslink"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipfs%2Fgo-dnslink","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipfs%2Fgo-dnslink/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipfs%2Fgo-dnslink/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipfs%2Fgo-dnslink/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ipfs","download_url":"https://codeload.github.com/ipfs/go-dnslink/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234883315,"owners_count":18901365,"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","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":"2024-09-24T13:12:18.657Z","updated_at":"2025-10-01T16:31:53.281Z","avatar_url":"https://github.com/ipfs.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ⚠️ Deprecated in favor of [dnslink-std/go](https://github.com/dnslink-std/go)\n\n- 👉  this project is no longer maintained, greenfield projects should use  [dnslink-std/go](https://github.com/dnslink-std/go)\n- we will convert this repo to a thin arapper around [dnslink-std/go](https://github.com/dnslink-std/go) at some point – see [#15](https://github.com/ipfs/go-dnslink/issues/15)\n\n# go-dnslink\n\n[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io)\n[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)\n[![](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://ipfs.io/)\n\n\u003e dnslink resolution in go-ipfs\n\n## Table of Contents\n\n- [Background](#background)\n- [Install](#install)\n- [Usage](#usage)\n  - [As a library](#as-a-library)\n  - [As a commandline tool](#as-a-commandline-tool)\n- [Contribute](#contribute)\n  - [Want to hack on IPFS?](#want-to-hack-on-ipfs)\n- [License](#license)\n\n## Background\n\nPackage dnslink implements a DNS link resolver. dnslink is a basic\nstandard for placing traversable links in DNS itself. See dnslink.info\n\nA dnslink is a path link in a DNS TXT record, like this:\n\n```\ndnslink=/ipfs/QmR7tiySn6vFHcEjBeZNtYGAFh735PJHfEMdVEycj9jAPy\n```\n\nFor example:\n\n```\n\u003e dig TXT ipfs.io\nipfs.io.  120   IN  TXT  dnslink=/ipfs/QmR7tiySn6vFHcEjBeZNtYGAFh735PJHfEMdVEycj9jAPy\n```\n\nThis package eases resolving and working with thse DNS links. For example:\n\n```go\nimport (\n  dnslink \"github.com/ipfs/go-dnslink\"\n)\n\nlink, err := dnslink.Resolve(\"ipfs.io\")\n// link = \"/ipfs/QmR7tiySn6vFHcEjBeZNtYGAFh735PJHfEMdVEycj9jAPy\"\n```\n\nIt even supports recursive resolution. Suppose you have three domains with\ndnslink records like these:\n\n```\n\u003e dig TXT foo.com\nfoo.com.  120   IN  TXT  dnslink=/ipns/bar.com/f/o/o\n\u003e dig TXT bar.com\nbar.com.  120   IN  TXT  dnslink=/ipns/long.test.baz.it/b/a/r\n\u003e dig TXT long.test.baz.it\nlong.test.baz.it.  120   IN  TXT  dnslink=/b/a/z\n```\n\nExpect these resolutions:\n\n```go\ndnslink.ResolveN(\"long.test.baz.it\", 0) // \"/ipns/long.test.baz.it\"\ndnslink.Resolve(\"long.test.baz.it\")     // \"/b/a/z\"\n\ndnslink.ResolveN(\"bar.com\", 1)          // \"/ipns/long.test.baz.it/b/a/r\"\ndnslink.Resolve(\"bar.com\")              // \"/b/a/z/b/a/r\"\n\ndnslink.ResolveN(\"foo.com\", 1)          // \"/ipns/bar.com/f/o/o/\"\ndnslink.ResolveN(\"foo.com\", 2)          // \"/ipns/long.test.baz.it/b/a/r/f/o/o/\"\ndnslink.Resolve(\"foo.com\")              // \"/b/a/z/b/a/r/f/o/o\"\n```\n\n## Install\n\n```sh\ngo get github.com/ipfs/go-dnslink\n```\n\n## Usage\n\n### As a library\n\n```go\nimport (\n  log\n  fmt\n\n  dnslink \"github.com/ipfs/go-dnslink\"\n)\n\nfunc main() {\n  link, err := dnslink.Resolve(\"ipfs.io\")\n  if err != nil {\n    log.Fatal(err)\n  }\n\n  fmt.Println(link) // string path\n}\n```\n\n### As a commandline tool\n\nCheck out [the commandline tool](dnslink/), which works like this:\n\n```sh\n\u003e dnslink ipfs.io\n/ipfs/QmR7tiySn6vFHcEjBeZNtYGAFh735PJHfEMdVEycj9jAPy\n```\n\n## Contribute\n\nFeel free to join in. All welcome. Open an [issue](https://github.com/ipfs/go-dnslink/issues)!\n\nThis repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).\n\n### Want to hack on IPFS?\n\n[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/contributing.md)\n\n## License\n\n[MIT](LICENSE) © Juan Benet-Batiz\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipfs%2Fgo-dnslink","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fipfs%2Fgo-dnslink","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipfs%2Fgo-dnslink/lists"}