mirror of
https://github.com/taigrr/godns
synced 2025-01-18 04:03:25 -08:00
Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
5ad83edfe8 | ||
|
069fd1dcb5 | ||
|
fa03a1b959 | ||
|
17c9b6fa17 | ||
|
6dfbb60dfd | ||
|
07e5d7f99e | ||
|
10c67fa23a | ||
|
afc6ba8241 | ||
|
7ac3eed730 | ||
|
ac7dc021eb | ||
|
2154fcc762 | ||
|
99af25e496 | ||
|
dd4805df92 | ||
|
cdf32c509d |
4
.github/workflows/go.yml
vendored
4
.github/workflows/go.yml
vendored
@ -7,10 +7,10 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Set up Go 1.13.6
|
- name: Set up Go 1.15.7
|
||||||
uses: actions/setup-go@v1
|
uses: actions/setup-go@v1
|
||||||
with:
|
with:
|
||||||
go-version: 1.13.6
|
go-version: 1.15.7
|
||||||
id: go
|
id: go
|
||||||
|
|
||||||
- name: Check out code into the Go module directory
|
- name: Check out code into the Go module directory
|
||||||
|
13
Dockerfile
13
Dockerfile
@ -2,13 +2,8 @@ FROM golang:alpine AS builder
|
|||||||
RUN mkdir /godns
|
RUN mkdir /godns
|
||||||
ADD . /godns/
|
ADD . /godns/
|
||||||
WORKDIR /godns
|
WORKDIR /godns
|
||||||
RUN go build -o godns cmd/godns/godns.go
|
RUN CGO_ENABLED=0 go build -o godns cmd/godns/godns.go
|
||||||
|
|
||||||
FROM alpine
|
FROM gcr.io/distroless/base
|
||||||
RUN apk add --no-cache ca-certificates tzdata
|
COPY --from=builder /godns/godns /godns
|
||||||
RUN mkdir /usr/local/godns
|
ENTRYPOINT ["/godns"]
|
||||||
COPY --from=builder /godns/godns /usr/local/godns
|
|
||||||
RUN chmod +x /usr/local/godns/godns
|
|
||||||
RUN rm -rf /var/cache/apk/*
|
|
||||||
WORKDIR /usr/local/godns
|
|
||||||
ENTRYPOINT ["./godns", "-c", "/usr/local/godns/config.json"]
|
|
6
Makefile
6
Makefile
@ -2,15 +2,15 @@
|
|||||||
BINARY=godns
|
BINARY=godns
|
||||||
# Builds the project
|
# Builds the project
|
||||||
build:
|
build:
|
||||||
GO111MODULE=on go build cmd/godns/godns.go -o ${BINARY} -ldflags "-X main.Version=${VERSION}"
|
GO111MODULE=on go build -ldflags "-X main.Version=${VERSION}" -o ${BINARY} cmd/godns/godns.go
|
||||||
# Installs our project: copies binaries
|
# Installs our project: copies binaries
|
||||||
install:
|
install:
|
||||||
GO111MODULE=on go install
|
GO111MODULE=on go install
|
||||||
image:
|
image:
|
||||||
# Build docker image
|
# Build docker image
|
||||||
go clean
|
go clean
|
||||||
docker buildx build --platform linux/amd64,linux/386,linux/arm64,linux/arm/v7 -t timothyye/godns:${VERSION} . --push
|
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t timothyye/godns:${VERSION} . --push
|
||||||
docker buildx build --platform linux/amd64,linux/386,linux/arm64,linux/arm/v7 -t timothyye/godns:latest . --push
|
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t timothyye/godns:latest . --push
|
||||||
release:
|
release:
|
||||||
# Clean
|
# Clean
|
||||||
go clean
|
go clean
|
||||||
|
26
README.md
26
README.md
@ -22,6 +22,8 @@
|
|||||||
|
|
||||||
[GoDNS](https://github.com/TimothyYe/godns) is a dynamic DNS (DDNS) client tool. It is a rewrite in [Go](https://golang.org) of my early [DynDNS](https://github.com/TimothyYe/DynDNS) open source project.
|
[GoDNS](https://github.com/TimothyYe/godns) is a dynamic DNS (DDNS) client tool. It is a rewrite in [Go](https://golang.org) of my early [DynDNS](https://github.com/TimothyYe/DynDNS) open source project.
|
||||||
|
|
||||||
|
Currently supports updating A records for subdomains. Doesn't support updating of root domains.
|
||||||
|
|
||||||
---
|
---
|
||||||
- [Supported DNS Providers](#supported-dns-providers)
|
- [Supported DNS Providers](#supported-dns-providers)
|
||||||
- [Supported Platforms](#supported-platforms)
|
- [Supported Platforms](#supported-platforms)
|
||||||
@ -59,16 +61,16 @@
|
|||||||
---
|
---
|
||||||
## Supported DNS Providers
|
## Supported DNS Providers
|
||||||
|
|
||||||
| Provider | IPv4 support | IPv6 support |
|
| Provider | IPv4 support | IPv6 support | Root Domain | Subdomains |
|
||||||
| ------------------------------------- | :----------------: | :----------------: |
|
| ------------------------------------- | :----------------: | :----------------: | :----------------: | :----------------: |
|
||||||
| [Cloudflare][cloudflare] | :white_check_mark: | :white_check_mark: |
|
| [Cloudflare][cloudflare] | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
||||||
| [Google Domains][google.domains] | :white_check_mark: | :white_check_mark: |
|
| [Google Domains][google.domains] | :white_check_mark: | :white_check_mark: | :x: | :white_check_mark: |
|
||||||
| [DNSPod][dnspod] | :white_check_mark: | :white_check_mark: |
|
| [DNSPod][dnspod] | :white_check_mark: | :white_check_mark: | :x: | :white_check_mark: |
|
||||||
| [HE.net (Hurricane Electric)][he.net] | :white_check_mark: | :white_check_mark: |
|
| [HE.net (Hurricane Electric)][he.net] | :white_check_mark: | :white_check_mark: | :x: | :white_check_mark: |
|
||||||
| [AliDNS][alidns] | :white_check_mark: | :x: |
|
| [AliDNS][alidns] | :white_check_mark: | :x: | :x: | :white_check_mark: |
|
||||||
| [DuckDNS][duckdns] | :white_check_mark: | :white_check_mark: |
|
| [DuckDNS][duckdns] | :white_check_mark: | :white_check_mark: | :x: | :white_check_mark: |
|
||||||
| [Dreamhost][dreamhost] | :white_check_mark: | :white_check_mark: |
|
| [Dreamhost][dreamhost] | :white_check_mark: | :white_check_mark: | :x: | :white_check_mark: |
|
||||||
| [No-IP][no-ip] | :white_check_mark: | :white_check_mark: |
|
| [No-IP][no-ip] | :white_check_mark: | :white_check_mark: | :x: | :white_check_mark: |
|
||||||
|
|
||||||
[cloudflare]: https://cloudflare.com
|
[cloudflare]: https://cloudflare.com
|
||||||
[google.domains]: https://domains.google
|
[google.domains]: https://domains.google
|
||||||
@ -79,6 +81,8 @@
|
|||||||
[dreamhost]: https://www.dreamhost.com
|
[dreamhost]: https://www.dreamhost.com
|
||||||
[no-ip]: https://www.noip.com
|
[no-ip]: https://www.noip.com
|
||||||
|
|
||||||
|
Tip: You can follow this [issue](https://github.com/TimothyYe/godns/issues/76) to view the current status of DDNS for root domains.
|
||||||
|
|
||||||
## Supported Platforms
|
## Supported Platforms
|
||||||
|
|
||||||
* Linux
|
* Linux
|
||||||
@ -582,7 +586,7 @@ With `/path/to/config.json` your local configuration file, run:
|
|||||||
```bash
|
```bash
|
||||||
docker run \
|
docker run \
|
||||||
-d --name godns --restart=always \
|
-d --name godns --restart=always \
|
||||||
-v /path/to/config.json:/usr/local/godns/config.json \
|
-v /path/to/config.json:/config.json \
|
||||||
timothyye/godns:latest
|
timothyye/godns:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -128,6 +128,9 @@ func (handler *Handler) DomainLoop(domain *godns.Domain, panicChan chan<- godns.
|
|||||||
|
|
||||||
// Check if record is present in domain conf
|
// Check if record is present in domain conf
|
||||||
func recordTracked(domain *godns.Domain, record *DNSRecord) bool {
|
func recordTracked(domain *godns.Domain, record *DNSRecord) bool {
|
||||||
|
if record.Name == domain.DomainName {
|
||||||
|
return true
|
||||||
|
}
|
||||||
for _, subDomain := range domain.SubDomains {
|
for _, subDomain := range domain.SubDomains {
|
||||||
sd := fmt.Sprintf("%s.%s", subDomain, domain.DomainName)
|
sd := fmt.Sprintf("%s.%s", subDomain, domain.DomainName)
|
||||||
if record.Name == sd {
|
if record.Name == sd {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user