Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HOSTINGDE: creating zones broken #2276

Closed
Yannik opened this issue Apr 14, 2023 · 5 comments · Fixed by #2297
Closed

HOSTINGDE: creating zones broken #2276

Yannik opened this issue Apr 14, 2023 · 5 comments · Fixed by #2297

Comments

@Yannik
Copy link
Contributor

Yannik commented Apr 14, 2023

Creating zones seems to be broken for HOSTINGDE.

dnsconfig.js:

var REG_HOSTINGDE = NewRegistrar("hosting.de");
var DSP_HOSTINGDE = NewDnsProvider("hosting.de");

D("examplealsdfaesf.net", REG_HOSTINGDE, DnsProvider(DSP_HOSTINGDE),
    A("test", "1.2.3.4")
);

creds.json:

{
  "hosting.de": {
    "TYPE": "HOSTINGDE",
    "authToken": "<token>"
  }
}

Results in error:

******************** Domain: examplealsdfaesf.net
WARNING: Error creating domain: error creating zone: [{Code:12001 ContextObject: ContextPath:records[0].content Text:Domain name 'ns1.hosting.de.' is invalid Value:ns1.hosting.de.} {Code:12001 ContextObject: ContextPath:records[1].content Text:Domain name 'ns2.hosting.de.' is invalid Value:ns2.hosting.de.} {Code:12001 ContextObject: ContextPath:records[2].content Text:Domain name 'ns3.hosting.de.' is invalid Value:ns3.hosting.de.}]
WARNING: No nameservers declared; skipping registrar. Add {no_ns:'true'} to force.
@Yannik
Copy link
Contributor Author

Yannik commented Apr 14, 2023

When creating a zone via the webinterface, the requests look like this:

(with default nameservers)

{
  "nameserverSetId": null,
  "records": [
    {
      "content": "8.8.8.8",
      "name": "alijselifjaselfasf.de",
      "ttl": 86400,
      "type": "A"
    },
    {
      "content": "mail.alijselifjaselfasf.de",
      "name": "alijselifjaselfasf.de",
      "priority": 10,
      "ttl": 86400,
      "type": "MX"
    },
    {
      "content": "8.8.8.8",
      "name": "mail.alijselifjaselfasf.de",
      "ttl": 86400,
      "type": "A"
    }
  ],
  "useDefaultNameserverSet": true,
  "zoneConfig": {
    "accountId": "xxx",
    "name": "alijselifjaselfasf.de",
    "type": "NATIVE"
  },
  "authToken": "xxx"
}

with custom nameservers:

{
  "nameserverSetId": null,
  "records": [
    {
      "content": "8.8.8.8",
      "name": "aijseiajseflijasef.com",
      "ttl": 86400,
      "type": "A"
    },
    {
      "content": "ns1.hosting.de",
      "name": "aijseiajseflijasef.com",
      "ttl": 86400,
      "type": "NS"
    },
    {
      "content": "ns2.hosting.de",
      "name": "aijseiajseflijasef.com",
      "ttl": 86400,
      "type": "NS"
    },
    {
      "content": "mail.aijseiajseflijasef.com",
      "name": "aijseiajseflijasef.com",
      "priority": 10,
      "ttl": 86400,
      "type": "MX"
    },
    {
      "content": "8.8.8.8",
      "name": "mail.aijseiajseflijasef.com",
      "ttl": 86400,
      "type": "A"
    }
  ],
  "useDefaultNameserverSet": false,
  "zoneConfig": {
    "accountId": "xxx",
    "name": "aijseiajseflijasef.com",
    "type": "NATIVE"
  },
  "authToken": "xxx"
}

The request from dnscontrol does specify nameservers (even though non are specified in creds.js/dnsconfig.js), and terminates them with a dot, which seems to be the cause of this issue.

{
  "zoneConfig": {
    "id": "",
    "dnsSecMode": "",
    "masterIp": "",
    "name": "examplealsdfaesf.net",
    "nameUnicode": "",
    "soaValues": {
      "refresh": 0,
      "retry": 0,
      "expire": 0,
      "negativeTtl": 0,
      "ttl": 0
    },
    "type": "NATIVE",
    "zoneTransferWhitelist": null
  },
  "records": [
    {
      "id": "",
      "name": "examplealsdfaesf.net",
      "type": "NS",
      "content": "ns1.hosting.de.",
      "ttl": 86400,
      "priority": 0
    },
    {
      "id": "",
      "name": "examplealsdfaesf.net",
      "type": "NS",
      "content": "ns2.hosting.de.",
      "ttl": 86400,
      "priority": 0
    },
    {
      "id": "",
      "name": "examplealsdfaesf.net",
      "type": "NS",
      "content": "ns3.hosting.de.",
      "ttl": 86400,
      "priority": 0
    }
  ],
  "domain": null
}

@Yannik
Copy link
Contributor Author

Yannik commented Apr 14, 2023

Removing the trailing dot in

var defaultNameservers = []string{"ns1.hosting.de.", "ns2.hosting.de.", "ns3.hosting.de."}
leads to this error: ERROR: ERROR: provider code already removed nameserver trailing dot (ns1.hosting.de).

@tlimoncelli What do you suggest should be done to fix this?

@Yannik
Copy link
Contributor Author

Yannik commented Apr 24, 2023

@tlimoncelli Would love your input on this.

@tlimoncelli
Copy link
Contributor

Generally this means your calling models.ToNameserversStripTD instead of models.ToNameservers

Try changing that in hostingdeProvider.go and see if that fixes it.

Tom

@Yannik
Copy link
Contributor Author

Yannik commented Apr 25, 2023

Hi Tom,
based on your suggestion I have created PR #2297 which seems to fix the issue.

tlimoncelli added a commit that referenced this issue Apr 25, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Co-authored-by: Yannik Sembritzki <yannik@sembritzki.org>
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants