Skip to content

Commit 78f3061

Browse files
authored
feat(providers): namesilo.com support (#866)
- Credits to @Zeustopher for writing most of the readme
1 parent 03154c3 commit 78f3061

File tree

11 files changed

+380
-0
lines changed

11 files changed

+380
-0
lines changed

.github/workflows/configs/mlc-config.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
},
3333
{
3434
"pattern": "^https://my.vultr.com/settings/#settingsapi$"
35+
},
36+
{
37+
"pattern": "^https://www.namesilo.com"
3538
}
3639
],
3740
"timeout": "20s",

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ This readme and the [docs/](docs/) directory are **versioned** to match the prog
8181
- Myaddr
8282
- Name.com
8383
- Namecheap
84+
- NameSilo
8485
- Netcup
8586
- NoIP
8687
- Now-DNS
@@ -247,6 +248,7 @@ Check the documentation for your DNS provider:
247248
- [Myaddr](docs/myaddr.md)
248249
- [Name.com](docs/name.com.md)
249250
- [Namecheap](docs/namecheap.md)
251+
- [NameSilo](docs/namesilo.md)
250252
- [Netcup](docs/netcup.md)
251253
- [NoIP](docs/noip.md)
252254
- [Now-DNS](docs/nowdns.md)

docs/namesilo.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# NameSilo
2+
3+
[![NameSilo Website](../readme/namesilo.jpg)](https://www.namesilo.com)
4+
5+
## Configuration
6+
7+
### Example
8+
9+
```json
10+
{
11+
"settings": [
12+
{
13+
"provider": "namesilo",
14+
"domain": "sub.example.com",
15+
"key": "71dZaE8c2Aa926Ca2E8c1",
16+
"ttl": 7207,
17+
"ip_version": "ipv4"
18+
}
19+
]
20+
}
21+
```
22+
23+
### Compulsory parameters
24+
25+
- `"domain"` is the domain to update. It can be `example.com` (root domain), `sub.example.com` (subdomain of `example.com`) or `*.example.com` for the wildcard.
26+
- `"key"` is the NameSilo API Key obtained using the domain setup instructions below. For example: `71dZaE8c2Aa926Ca2E8c1`.
27+
28+
### Optional parameters
29+
30+
- `"ip_version"` can be `ipv4` (A records), or `ipv6` (AAAA records) or `ipv4 or ipv6` (update one of the two, depending on the public ip found). It defaults to `ipv4 or ipv6`.
31+
- `"ipv6_suffix"` is the IPv6 interface identifier suffix to use. It can be for example `0:0:0:0:72ad:8fbb:a54e:bedd/64`. If left empty, it defaults to no suffix and the raw public IPv6 address obtained is used in the record updating.
32+
- `"ttl"` is the record's Time to Live (TTL), which defaults to `7207` seconds. It must be numeric, less than `2592001`, and greater than or equal to `3600`. TTL values of `3603` or `7207` may be subject to NameSilo's [Automatic TTL Adjustments](https://www.namesilo.com/support/v2/articles/domain-manager/dns-manager#auto_ttl).
33+
34+
## Domain setup
35+
36+
1. Login to the [Namesilo API Manager](https://www.namesilo.com/account/api-manager) with your account credentials.
37+
1. Generate an API key. The generated API key will look similar to `71dZaE8c2Aa926Ca2E8c1`.
38+
- (do _not_ check the "Generate key for read-only access" box)
39+
40+
[![Before NameSilo API Key](../readme/namesilo1.jpg)](https://www.namesilo.com/account/api-manager)
41+
[![After NameSilo API Key](../readme/namesilo2.jpg)](https://www.namesilo.com/account/api-manager)
42+
43+
## Testing
44+
45+
1. Go to the [NameSilo Domain Manager](https://www.namesilo.com/account_domains.php).
46+
1. Choose "Manage DNS for this domain" (the globe icon) for the domain you wish to test.
47+
[![Manage DNS for this domain](../readme/namesilo3.jpg)](https://www.namesilo.com/account_domains.php)
48+
49+
1. Change the IP address of the host to `127.0.0.1`.
50+
1. Run the ddns-updater.
51+
1. Refresh the Namesilo webpage to check the update occurred.

internal/provider/constants/providers.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ const (
4040
Myaddr models.Provider = "myaddr"
4141
Namecheap models.Provider = "namecheap"
4242
NameCom models.Provider = "name.com"
43+
NameSilo models.Provider = "namesilo"
4344
Netcup models.Provider = "netcup"
4445
Njalla models.Provider = "njalla"
4546
NoIP models.Provider = "noip"
@@ -94,6 +95,7 @@ func ProviderChoices() []models.Provider {
9495
Myaddr,
9596
Namecheap,
9697
NameCom,
98+
NameSilo,
9799
Njalla,
98100
NoIP,
99101
NowDNS,

internal/provider/errors/validation.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ var (
3030
ErrTokenNotValid = errors.New("token is not valid")
3131
ErrTTLNotSet = errors.New("TTL is not set")
3232
ErrTTLTooLow = errors.New("TTL is too low")
33+
ErrTTLTooHigh = errors.New("TTL is too high")
3334
ErrURLNotHTTPS = errors.New("url is not https")
3435
ErrURLNotSet = errors.New("url is not set")
3536
ErrUsernameNotSet = errors.New("username is not set")

internal/provider/provider.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ import (
4646
"github.com/qdm12/ddns-updater/internal/provider/providers/myaddr"
4747
"github.com/qdm12/ddns-updater/internal/provider/providers/namecheap"
4848
"github.com/qdm12/ddns-updater/internal/provider/providers/namecom"
49+
"github.com/qdm12/ddns-updater/internal/provider/providers/namesilo"
4950
"github.com/qdm12/ddns-updater/internal/provider/providers/netcup"
5051
"github.com/qdm12/ddns-updater/internal/provider/providers/njalla"
5152
"github.com/qdm12/ddns-updater/internal/provider/providers/noip"
@@ -155,6 +156,8 @@ func New(providerName models.Provider, data json.RawMessage, domain, owner strin
155156
return namecheap.New(data, domain, owner)
156157
case constants.NameCom:
157158
return namecom.New(data, domain, owner, ipVersion, ipv6Suffix)
159+
case constants.NameSilo:
160+
return namesilo.New(data, domain, owner, ipVersion, ipv6Suffix)
158161
case constants.Netcup:
159162
return netcup.New(data, domain, owner, ipVersion, ipv6Suffix)
160163
case constants.Njalla:

0 commit comments

Comments
 (0)