{"id":18544040,"url":"https://github.com/themimitoof/ipg","last_synced_at":"2025-04-23T20:45:51.390Z","repository":{"id":59042807,"uuid":"525573724","full_name":"Themimitoof/ipg","owner":"Themimitoof","description":"A simple IPv6 address generator for lazy netadmins ","archived":false,"fork":false,"pushed_at":"2022-08-22T14:24:24.000Z","size":21,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-30T03:22:50.791Z","etag":null,"topics":["golang","ip-generation","ipv6","netadmin","netops","ops"],"latest_commit_sha":null,"homepage":"https://mvieira.fr/projects/ipg/","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/Themimitoof.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":"2022-08-16T23:30:21.000Z","updated_at":"2025-01-27T21:32:43.000Z","dependencies_parsed_at":"2022-09-11T04:41:27.265Z","dependency_job_id":null,"html_url":"https://github.com/Themimitoof/ipg","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Themimitoof%2Fipg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Themimitoof%2Fipg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Themimitoof%2Fipg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Themimitoof%2Fipg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Themimitoof","download_url":"https://codeload.github.com/Themimitoof/ipg/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250513380,"owners_count":21443200,"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":["golang","ip-generation","ipv6","netadmin","netops","ops"],"created_at":"2024-11-06T20:15:11.320Z","updated_at":"2025-04-23T20:45:51.340Z","avatar_url":"https://github.com/Themimitoof.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ipg: A simple IPv6 address generator for lazy netadmins\n![GitHub](https://img.shields.io/github/license/themimitoof/ipg) ![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/themimitoof/ipg) [![codecov](https://codecov.io/gh/Themimitoof/ipg/branch/main/graph/badge.svg?token=43QQLDVUQ5)](https://codecov.io/gh/Themimitoof/ipg)\n\n\n`ipg` is a small tool for netadmins wanting to generate random IPv6 addresses or based on the\nhostname of a machine and want to obtain the DNS and PTR records ready to paste on their DNS zone.\n\n`ipg` is a replacement of an old script I created in 2020 called\n[v6gen](https://github.com/Themimitoof/v6gen).\n\n## Features\n\n - Generate a random IPv6 address\n - Generate an IPv6 based on the given hostname\n - Return the ARPA version of the IPv6 address\n - Return a DNS and/or a PTR record\n - Get the output in a JSON format or in a more humain friendly one\n\n## Installation\n\nYou can get the binaries for your operating system and your platform architecture from the\n[releases page](https://github.com/Themimitoof/ipg/releases).\n\nYou can also compile and install it manually by simply typing:\n\n```bash\ngo install github.com/themimitoof/ipg\n```\n\nYou can also use the Docker image by typing:\n\n```bash\ndocker run --rm ghcr.io/themimitoof/ipg --help\n```\n\n**Note:** You can also pull the image based on the ``main`` branch or from a specific version by typing:\n\n```\ndocker pull ghcr.io/themimitoof/ipg:main\n# or\ndocker pull ghcr.io/themimitoof/ipg:v1.0.0\n```\n\n## Usage\n\n```bash\n$ ipg --help\nUsage: ipg \u003csubnet\u003e\n\nA simple IPv6 generator for lazy netadmins.\n\nArguments:\n  \u003csubnet\u003e    IPv6 Subnet\n\nFlags:\n  -h, --help                Show context-sensitive help.\n  -r, --random              Generate a random IPv6 address on the given subnet.\n  -n, --name=\"hostname\"     Specify the hostname of a machine, an IPv6 address will be generated based on it.\n  -s, --silent              Only display values without their labels.\n  -f, --format=\"console\"    Specify the type of output. Possible values: console, json\n  -a, --address             Display the generated IP address.\n  -R, --reverse             Display the ARPA version of the IP address.\n  -d, --dns                 Returns a DNS record ready to paste to a DNS zone.\n  -x, --rrecord             Returns a rDNS record ready to paste to a DNS zone.\n  -t, --ttl=86400           TTL value for DNS returned DNS records.\n```\n\nTo generate a random IPv6 address:\n\n```bash\n$ ipg -r 2001:db8:beef::/64\nIP address: 2001:db8:beef:0:9e20:7abf:4b9c:2d45\nReverse IP address: 5.4.d.2.c.9.b.4.f.b.a.7.0.2.e.9.0.0.0.0.f.e.e.b.8.b.d.0.1.0.0.2.ip6.arpa\nDNS record: hostname    86400    IN    AAAA    2001:db8:beef:0:9e20:7abf:4b9c:2d45\nARPA DNS record: 5.4.d.2.c.9.b.4.f.b.a.7.0.2.e.9.0.0.0.0.f.e.e.b.8.b.d.0.1.0.0.2.ip6.arpa.    86400    IN    PTR    hostname\n```\n\nTo generate an IPv6 address based on the hostname of a machine:\n\n```bash\n$ ipg -n hello 2001:db8:beef::/64\nIP address: 2001:db8:beef::68:656c:6c6f\nReverse IP address: f.6.c.6.c.6.5.6.8.6.0.0.0.0.0.0.0.0.0.0.f.e.e.b.8.b.d.0.1.0.0.2.ip6.arpa\nDNS record: hello    86400    IN    AAAA    2001:db8:beef::68:656c:6c6f\nARPA DNS record: f.6.c.6.c.6.5.6.8.6.0.0.0.0.0.0.0.0.0.0.f.e.e.b.8.b.d.0.1.0.0.2.ip6.arpa.    86400    IN    PTR    hello\n```\n\nYou can also get a random IPv6 address and give the hostname of the machine to obtain a ready to paste DNS record:\n\n```bash\n$ ipg -rn hello.foobar.com 2001:db8:beef::/64\nIP address: 2001:db8:beef:0:9639:1d78:7e2a:9646\nReverse IP address: 6.4.6.9.a.2.e.7.8.7.d.1.9.3.6.9.0.0.0.0.f.e.e.b.8.b.d.0.1.0.0.2.ip6.arpa\nDNS record: hello.foobar.com.    86400    IN    AAAA    2001:db8:beef:0:9639:1d78:7e2a:9646\nARPA DNS record: 6.4.6.9.a.2.e.7.8.7.d.1.9.3.6.9.0.0.0.0.f.e.e.b.8.b.d.0.1.0.0.2.ip6.arpa.    86400    IN    PTR    hello.foobar.com\n```\n\nIf you want to obtain one specific or multiple information like the IPv6 address and the reverse version:\n\n```bash\n$ ipg -rRa  2001:db8:beef::/64\nIP address: 2001:db8:beef:0:d5b:ca60:88be:bfd1\nReverse IP address: 1.d.f.b.e.b.8.8.0.6.a.c.b.5.d.0.0.0.0.0.f.e.e.b.8.b.d.0.1.0.0.2.ip6.arpa\n```\n\nIf you want to get an information without its label (e.g for piping with another command), use `-s` flag:\n\n```bash\n$ ipg -ras  2001:db8:beef::/64\n2001:db8:beef:0:d5b:ca60:88be:bfd1\n```\n\nIf you want to get a JSON version of the output:\n\n```bash\n$ ipg -r -n hello.foobar.com -f json 2001:db8:beef::/64 | jq\n{\n  \"hostname\": \"hello.foobar.com\",\n  \"ip_addr\": \"2001:db8:beef:0:5462:5f99:1a46:a2bc\",\n  \"arpa_addr\": \"c.b.2.a.6.4.a.1.9.9.f.5.2.6.4.5.0.0.0.0.f.e.e.b.8.b.d.0.1.0.0.2.ip6.arpa\",\n  \"dns_record\": \"hello.foobar.com.    86400    IN    AAAA    2001:db8:beef:0:5462:5f99:1a46:a2bc\",\n  \"ptr_record\": \"c.b.2.a.6.4.a.1.9.9.f.5.2.6.4.5.0.0.0.0.f.e.e.b.8.b.d.0.1.0.0.2.ip6.arpa.    86400    IN    PTR    hello.foobar.com\"\n}\n```\n\n**Note:** filters are not available with the `json` format.\n\n## Contributions\n\nIn case you have a suggestion or want a new feature, feel free to open a [discussion](https://github.com/Themimitoof/ipg/discussions).\n\nIf you found a bug, you can [open an issue](https://github.com/Themimitoof/ipg/issues).\n\nIn case you are able to fix by yourself a bug, enhance the code or implement a new feature, feel free to send a [Pull request](https://github.com/Themimitoof/ipg/pulls).\n\n## License\n\nThis project is released under the [MIT license](LICENSE). Feel free to use, contribute, fork and do\nwhat you want with it. Please keep all licenses, copyright notices and mentions in case you use,\nre-use, steal, fork code from this repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthemimitoof%2Fipg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthemimitoof%2Fipg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthemimitoof%2Fipg/lists"}