<p>I needed to put a trailing period into the "ns" record in the blockchain.  Then the correct nameserver was used.</p>

<p>Also, ncdns is NOT a recursive nameserver, so it returned the correct NS record but did not reach out to the nameserver for the IP.  I had to set up Unbound as described in the ncdns readme in order to actually resolve my .bit domain to an IP.</p>

CC BY-SA 3.0
2017-11-19T07:26:43.613Z
2017-11-19T07:26:43.613Z
jcarpenter2
<p>Basically, I'm setting up a .bit domain for my blog.  I have registered a domain using namecoin, and given it a nameserver entry on the blockchain:</p>

<pre><code>$ namecoin-cli name_show d/aoeu2code
{
  "name": "d/aoeu2code",
  "value": "{\"ns\": [\"ns.aoeu2code.com\"]}",
  "txid": "a49ad527f36fc41c47b8d743d376c3b011c7999dbf4d9da64afbdb3ccbdd8934",
  "vout": 1,
  "address": "NHE7a7xJF2XMQzCwg5PLggeTdZ3yQDvqmS",
  "height": 370929,
  "expires_in": 35991,
  "expired": false
}
</code></pre>

<p>The nameserver itself appears to be set up correctly.  When I dig for my .bit domain, the IP shows up as expected:</p>

<pre><code>$ dig aoeu2code.bit @ns.aoeu2code.com

; &lt;&lt;&gt;&gt; DiG 9.10.3-P4-Debian &lt;&lt;&gt;&gt; aoeu2code.bit @ns.aoeu2code.com
;; global options: +cmd
;; Got answer:
;; -&gt;&gt;HEADER&lt;&lt;- opcode: QUERY, status: NOERROR, id: 17650
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1
;; WARNING: recursion requested but not available

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;aoeu2code.bit.                 IN      A

;; ANSWER SECTION:
aoeu2code.bit.          604800  IN      A       69.180.151.171

;; AUTHORITY SECTION:
aoeu2code.bit.          604800  IN      NS      ns.aoeu2code.com.

;; Query time: 1 msec
;; SERVER: 69.180.151.171#53(69.180.151.171)
;; WHEN: Sat Nov 18 01:30:58 CST 2017
;; MSG SIZE  rcvd: 88
</code></pre>

<p>However, when I try to resolve my .bit domain via ncdns, it does not try to use my nameserver, it uses a different one, <code>ns.mydomain.com.mydomain.bit</code> instead of <code>ns.mydomain.com</code>:</p>

<pre><code>$ dig aoeu2code.bit @localhost -p 5300

; &lt;&lt;&gt;&gt; DiG 9.10.3-P4-Debian &lt;&lt;&gt;&gt; aoeu2code.bit @localhost -p 5300
;; global options: +cmd
;; Got answer:
;; -&gt;&gt;HEADER&lt;&lt;- opcode: QUERY, status: NOERROR, id: 25963
;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
;; WARNING: recursion requested but not available

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;aoeu2code.bit.                 IN      A

;; AUTHORITY SECTION:
aoeu2code.bit.          600     IN      NS      ns.aoeu2code.com.aoeu2code.bit.

;; Query time: 0 msec
;; SERVER: ::1#5300(::1)
;; WHEN: Sat Nov 18 01:24:44 CST 2017
;; MSG SIZE  rcvd: 73
</code></pre>

<p>BTW, I'd also like to be able to give myself coins on the testnet chain and run tests there, since I have been having a little bit of trouble obtaining namecoins.  I can run <code>namecoind -testnet</code> and <code>namecoin-cli -getinfo</code> shows my balance is 0, but other than that I have no clue how to use the testnet chain.</p>

<namecoin><dns><domain-registering>
ncdns uses the wrong nameserver to resolve .bit domain
jcarpenter2
# ncdns uses the wrong nameserver to resolve .bit domain

(Asked by: username_0 on 2017-11-18)

Basically, I'm setting up a .bit domain for my blog. I have registered a domain using namecoin, and given it a nameserver entry on the blockchain:

```
$ namecoin-cli name_show d/aoeu2code
{
  "name": "d/aoeu2code",
  "value": "{\"ns\": [\"ns.aoeu2code.com\"]}",
  "txid": "a49ad527f36fc41c47b8d743d376c3b011c7999dbf4d9da64afbdb3ccbdd8934",
  "vout": 1,
  "address": "NHE7a7xJF2XMQzCwg5PLggeTdZ3yQDvqmS",
  "height": 370929,
  "expires_in": 35991,
  "expired": false
}

```

The nameserver itself appears to be set up correctly. When I dig for my .bit domain, the IP shows up as expected:

```
$ dig aoeu2code.bit @ns.aoeu2code.com

; <<>> DiG 9.10.3-P4-Debian <<>> aoeu2code.bit @ns.aoeu2code.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 17650
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1
;; WARNING: recursion requested but not available

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;aoeu2code.bit.                 IN      A

;; ANSWER SECTION:
aoeu2code.bit.          604800  IN      A       69.180.151.171

;; AUTHORITY SECTION:
aoeu2code.bit.          604800  IN      NS      ns.aoeu2code.com.

;; Query time: 1 msec
;; SERVER: 69.180.151.171#53(69.180.151.171)
;; WHEN: Sat Nov 18 01:30:58 CST 2017
;; MSG SIZE  rcvd: 88

```

However, when I try to resolve my .bit domain via ncdns, it does not try to use my nameserver, it uses a different one, `ns.mydomain.com.mydomain.bit` instead of `ns.mydomain.com`:

```
$ dig aoeu2code.bit @localhost -p 5300

; <<>> DiG 9.10.3-P4-Debian <<>> aoeu2code.bit @localhost -p 5300
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 25963
;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
;; WARNING: recursion requested but not available

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;aoeu2code.bit.                 IN      A

;; AUTHORITY SECTION:
aoeu2code.bit.          600     IN      NS      ns.aoeu2code.com.aoeu2code.bit.

;; Query time: 0 msec
;; SERVER: ::1#5300(::1)
;; WHEN: Sat Nov 18 01:24:44 CST 2017
;; MSG SIZE  rcvd: 73

```

BTW, I'd also like to be able to give myself coins on the testnet chain and run tests there, since I have been having a little bit of trouble obtaining namecoins. I can run `namecoind -testnet` and `namecoin-cli -getinfo` shows my balance is 0, but other than that I have no clue how to use the testnet chain.

**Tags:** namecoin, dns, domain-registering


---

## 1 answers

### Answer by username_0 on 2017-11-19. Score: 0 | Accepted answer

I needed to put a trailing period into the "ns" record in the blockchain. Then the correct nameserver was used.

Also, ncdns is NOT a recursive nameserver, so it returned the correct NS record but did not reach out to the nameserver for the IP. I had to set up Unbound as described in the ncdns readme in order to actually resolve my .bit domain to an IP.


---

