{"id":18521794,"url":"https://github.com/gjbae1212/cloud-instance-dns","last_synced_at":"2025-04-09T09:33:31.805Z","repository":{"id":57534380,"uuid":"191708884","full_name":"gjbae1212/cloud-instance-dns","owner":"gjbae1212","description":" 🔎 A DNS that look up your aws(ec2), gcp(compute-engine) regardless of multi regions by instance-name or id.🌸","archived":false,"fork":false,"pushed_at":"2020-07-24T08:54:09.000Z","size":10600,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T04:43:25.935Z","etag":null,"topics":["aws","compute-engine","dns","ec2","gcp","go","golang"],"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/gjbae1212.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}},"created_at":"2019-06-13T07:01:02.000Z","updated_at":"2025-02-24T10:59:41.000Z","dependencies_parsed_at":"2022-09-26T18:21:33.827Z","dependency_job_id":null,"html_url":"https://github.com/gjbae1212/cloud-instance-dns","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gjbae1212%2Fcloud-instance-dns","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gjbae1212%2Fcloud-instance-dns/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gjbae1212%2Fcloud-instance-dns/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gjbae1212%2Fcloud-instance-dns/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gjbae1212","download_url":"https://codeload.github.com/gjbae1212/cloud-instance-dns/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248012864,"owners_count":21033254,"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":["aws","compute-engine","dns","ec2","gcp","go","golang"],"created_at":"2024-11-06T17:27:39.331Z","updated_at":"2025-04-09T09:33:26.788Z","avatar_url":"https://github.com/gjbae1212.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cloud-instance-dns\n \n\u003cp align=\"left\"\u003e\n\u003ca href=\"https://circleci.com/gh/gjbae1212/cloud-instance-dns\"\u003e\u003cimg src=\"https://circleci.com/gh/gjbae1212/cloud-instance-dns.svg?style=svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://hits.seeyoufarm.com\"/\u003e\u003cimg src=\"https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Fgjbae1212%2Fcloud-instance-dns\"/\u003e\u003c/a\u003e\n\u003ca href=\"/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-GREEN.svg\" alt=\"license\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://goreportcard.com/report/github.com/gjbae1212/cloud-instance-dns\"\u003e\u003cimg src=\"https://goreportcard.com/badge/github.com/gjbae1212/cloud-instance-dns\" alt=\"Go Report Card\" /\u003e\u003c/a\u003e \n\u003c/p\u003e\n\n## OVERVIEW\n**cloud-instance-dns** is DNS server that will look up public or private ip on AWS ec2 or GCP compute-engine.  \n**cloud-instance-dns** is supporting to search multi regions(zones) instances on clouds(AWS,GCP).   \nIn addition it could be searching private or public ip. \n\n## Getting Started\n### quickstart\n```bash\n\n# Mac\n$ ./dist/dns-darwin -c config.yaml\n\n# Linux\n$ ./dist/dns-linux -c config.yaml\n```\n\n### config(yaml) \n\n------\n\n#### spec\n```yaml\ndomain: DNS domain # EX) localhost, dns.example.com, hello.example.com ...  \nnameserver: public domain for server running on`cloud-instance-dns` # server public domain(never ip) running `cloud-instance-dns`\nport: port number\nemail: your email\nprviate: false or true # if you'd like to answer private-ip -\u003e true, but public-ip -\u003e false\naws:\n  enable: true or false # if your'd use to aws -\u003e true, but not -\u003e false\n  access_key: your-aws-access-key\n  secret_access_key: your-aws-secret-access-key\n  regions:\n    - your-aws-region-1\n    - your-aws-region-2\ngcp:\n  enable: true or false # if your'd use to gcp -\u003e true, but not -\u003e false\n  project_id: your-gcp-project-id\n  zones:\n    - your-gcp-zone-1\n    - your-gcp-zone-2\n  jwt: your-gcp-jwt-string\n```\n------\n\n#### config example\n\n- using AWS and GCP\n```yaml\ndomain: hello.example.com  \nnameserver: ec2-1.1.1.1.region.compute.amazonaws.com\nport: 53\nemail: gjbae1212@gmail.com\nprviate: true\naws:\n  enable: true\n  access_key: blahblah\n  secret_access_key: blahblah\n  regions:\n    - ap-northeast-1\n    - ap-northeast-2    \ngcp:\n  enable: true\n  project_id: gcp-project-id\n  zones:    \n    - asia-northeast1-a\n    - asia-northeast1-b    \n  jwt: '{\n          blahblah\n        }'\n```\n- only AWS\n```\ndomain: hello.example.com  \nnameserver: ec2-1.1.1.1.region.compute.amazonaws.com\nport: 53\nemail: gjbae1212@gmail.com\nprviate: true\naws:\n  enable: true\n  access_key: blahblah\n  secret_access_key: blahblah\n  regions:\n    - ap-northeast-1\n    - ap-northeast-2    \ngcp:\n  enable: false\n```\n-  only GCP\n```\ndomain: hello.example.com  \nnameserver: ec2-1.1.1.1.region.compute.amazonaws.com\nport: 53\nemail: gjbae1212@gmail.com\nprviate: true\naws:\n  enable: false  \ngcp:\n  enable: true\n  project_id: gcp-project-id\n  zones:    \n    - asia-northeast1-a\n    - asia-northeast1-b    \n  jwt: '{\n          blahblah\n        }'\n```\n------\n\n### usage\nYou will search to dns records following rule patterns below, Assume having `hello.example.com` dns\n\n- `(name or instacne-id).hello.example.com` will return instances matching name regardless cloud infra.  \n- `(num).(name or instacne-id).hello.example.com` will return a instance matching name and number.\n- `(name or instacne-id).aws.hello.example.com` will return instances matching name at aws.\n- `(num).(name or instacne-id).aws.hello.example.com` will return a instance matching name and number at aws.\n- `(name or instacne-id).gcp.hello.example.com` will return instances matching name at gcp.\n- `(num).(name or instacne-id).gcp.hello.example.com` will return a instance matching name and number at gcp.\n- `(name or instacne-id).rr.hello.example.com` will return instances matching name with dns round robin.\n\n### install\n```bash\n# your-machine\n$ bash local.sh build\n\n# linux\n$ bash local.sh linux_build\n\n# download\ngo to `https://github.com/gjbae1212/cloud-instance-dns/releases`\n\n# homebrew\n$ brew tap gjbae1212/cloud-instance-dns\n$ brew install cloud-instance-dns\n```\n\n## Explanation\nIf you would be setup to **cloud-instance-dns**, Be several attention. \n \n### AWS \n- aws.enable of config.yaml should be true when you'd like to use.\n- a aws_key must have permission to access ec2(ec2:DescribeInstances).\n- ingress port running **cloud-instance-dns** must open(port of config.yaml).\n\n### GCP\n- gcp.enable of config.yaml should be true when you'd like to use.\n- a gcp-jwt must have permission to access compute-engine(Compute Viewer).\n- ingress port running **cloud-instance-dns** must open(port of config.yaml).\n\n### Configure NS Record\nIf your **cloud-instance-dns** will register global DNS, you must input NS record from your domain.   \nAssume having `example.com` domain and you are running **cloud-instance-dns** on instance(assume public domain `ec2-1.1.1.1.region.compute.amazonaws.com`\u003cmust not be a IP\u003e).  \nAnd then you will make `hello.example.com.` DNS.\n```bash\n# DNS Domain(domain in your yaml)                      #TTL          # public hostname(nameserver in your yaml)    \nhello.example.com.                                     300   IN  NS  ec2-1.1.1.1.region.compute.amazonaws.com \n``` \nNS record value must not be a IP. It is public domain or hostname\u003ccould dns resolve\u003e. \n\n### Test\n- dig (name).hello.example.com @localhost  --\u003e  using localhost dns.\n- dig (name).hello.example.com @ec2-1.1.1.1.region.compute.amazonaws.com --\u003e check A record using your public dns. \n- dig NS hello.example.com   --\u003e check NS record using your public dns.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgjbae1212%2Fcloud-instance-dns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgjbae1212%2Fcloud-instance-dns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgjbae1212%2Fcloud-instance-dns/lists"}