Skip to content

Commit

Permalink
update deps; add arm64 build
Browse files Browse the repository at this point in the history
  • Loading branch information
mxssl committed Jul 28, 2023
1 parent 491e7ef commit bf3ab66
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 34 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.20
go-version: "1.20"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
version: latest
args: release --rm-dist
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7 changes: 1 addition & 6 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,15 @@ builds:
goos:
- linux
- darwin
- windows
goarch:
- amd64
- arm64
ldflags:
- -s -w -X github.com/mxssl/dns/cmd.version={{ .Version }}
archives:
- name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
files:
- none*
replacements:
darwin: Darwin
linux: Linux
windows: Windows
amd64: x86_64
checksum:
name_template: 'checksums.txt'
snapshot:
Expand Down
103 changes: 80 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,69 @@

`dns` is a simple CLI tool for [DNS-LG API](http://www.dns-lg.com)

<img src="./screen.png" alt="drawing" width="400"/>
```sh
dns a github.com
{
"question": [
{
"name": "github.com.",
"type": "A",
"class": "IN"
}
],
"answer": [
{
"name": "github.com.",
"type": "A",
"class": "IN",
"ttl": 60,
"rdlength": 4,
"rdata": "140.82.113.4"
}
]
}
```

## Install

### Download compiled binary

[Linux](https://github.com/mxssl/dns/releases/download/1.0.5/dns_Linux_x86_64.tar.gz)
[Linux amd64](https://github.com/mxssl/dns/releases/download/1.0.7/dns_Linux_x86_64.tar.gz)

[Windows](https://github.com/mxssl/dns/releases/download/1.0.5/dns_Windows_x86_64.tar.gz)
[MacOS amd64](https://github.com/mxssl/dns/releases/download/1.0.7/dns_darwin_amd64.tar.gz)

[MacOS](https://github.com/mxssl/dns/releases/download/1.0.5/dns_Darwin_x86_64.tar.gz)
[MacOS arm64](https://github.com/mxssl/dns/releases/download/1.0.7/dns_darwin_arm64.tar.gz)

### Examples

Linux:
Linux amd64:

```bash
wget https://github.com/mxssl/dns/releases/download/1.0.7/dns_linux_amd64.tar.gz
tar zvxf dns_linux_amd64.tar.gz
mv dns /usr/local/bin/dns
chmod +x /usr/local/bin/dns
rm dns_linux_amd64.tar.gz
```

MacOS amd64:

```bash
wget https://github.com/mxssl/dns/releases/download/1.0.5/dns_Linux_x86_64.tar.gz
tar zvxf dns_Linux_x86_64.tar.gz
cp dns /usr/local/bin/dns
wget https://github.com/mxssl/dns/releases/download/1.0.7/dns_darwin_amd64.tar.gz
tar zvxf dns_darwin_amd64.tar.gz
mv dns /usr/local/bin/dns
chmod +x /usr/local/bin/dns
rm dns_darwin_amd64.tar.gz
```

MacOS
MacOS arm64:

```bash
wget https://github.com/mxssl/dns/releases/download/1.0.5/dns_Darwin_x86_64.tar.gz
tar zvxf dns_Darwin_x86_64.tar.gz
cp dns /usr/local/bin/dns
wget https://github.com/mxssl/dns/releases/download/1.0.7/dns_darwin_arm64.tar.gz
tar zvxf dns_darwin_arm64.tar.gz
mv dns /usr/local/bin/dns
chmod +x /usr/local/bin/dns
rm dns_darwin_arm64.tar.gz
```

## Usage
Expand Down Expand Up @@ -89,23 +122,23 @@ Use "dns [command] --help" for more information about a command
## Example

```sh
dns a golang.com
dns a github.com
{
"question": [
{
"name": "golang.com.",
"name": "github.com.",
"type": "A",
"class": "IN"
}
],
"answer": [
{
"name": "golang.com.",
"name": "github.com.",
"type": "A",
"class": "IN",
"ttl": 299,
"ttl": 60,
"rdlength": 4,
"rdata": "216.58.198.81"
"rdata": "140.82.113.4"
}
]
}
Expand All @@ -127,24 +160,48 @@ You can use these resolvers:
| opendns2 | 208.67.220.220 |
| quad9 | 9.9.9.9 |

```sh
dns -r cloudflare a golang.com
```bash
dns a go.dev
{
"question": [
{
"name": "golang.com.",
"name": "go.dev.",
"type": "A",
"class": "IN"
}
],
"answer": [
{
"name": "golang.com.",
"name": "go.dev.",
"type": "A",
"class": "IN",
"ttl": 300,
"rdlength": 4,
"rdata": "216.239.34.21"
},
{
"name": "go.dev.",
"type": "A",
"class": "IN",
"ttl": 300,
"rdlength": 4,
"rdata": "216.239.32.21"
},
{
"name": "go.dev.",
"type": "A",
"class": "IN",
"ttl": 300,
"rdlength": 4,
"rdata": "216.239.36.21"
},
{
"name": "go.dev.",
"type": "A",
"class": "IN",
"ttl": 47,
"ttl": 300,
"rdlength": 4,
"rdata": "172.217.168.49"
"rdata": "216.239.38.21"
}
]
}
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ require (
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/pelletier/go-toml/v2 v2.0.9 // indirect
github.com/spf13/afero v1.9.5 // indirect
github.com/spf13/cast v1.5.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/sys v0.10.0 // indirect
golang.org/x/text v0.11.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
8 changes: 8 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyua
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ=
github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4=
github.com/pelletier/go-toml/v2 v2.0.9 h1:uH2qQXheeefCCkuBBSLi7jCiSmj3VRh2+Goq2N7Xxu0=
github.com/pelletier/go-toml/v2 v2.0.9/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
Expand Down Expand Up @@ -175,6 +177,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY=
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8=
github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0=
github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4=
Expand Down Expand Up @@ -318,6 +322,8 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA=
golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand All @@ -329,6 +335,8 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4=
golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
Expand Down
Binary file removed screen.png
Binary file not shown.

0 comments on commit bf3ab66

Please sign in to comment.