NMControl Configuration Ubuntu

Post Reply
forth
Posts: 2
Joined: Sun Mar 01, 2015 7:47 pm
os: linux
Location: Gothenburg, Sweden

NMControl Configuration Ubuntu

Post by forth »

Newcomer (Have indulgence).

My first reaction to namecon as a .bit name resolver: Great idea! I love it as much as i love bitcoin. Now i have 12 namecoins. 8-)
But nmcontrol is a litle hard to set up. I whish it where more examples and explanation on how it works.


Running on Ubunut 14.04 Workstation.

I use nmcontrol in front of my internet connection.

Startscript which places nmcontrol before the usual resolver. (namecoind already loaded)

Code: Select all

sudo sed -i 's/127.0.1.1/127.0.0.1/g' /etc/resolv.conf
sudo ./nmcontrol.py --dns.host=127.0.0.1 --dns.resolver=192.168.1.1,8.8.8.8 --daemon=0 --debug=1 start
My first question.
When i only set dns.resolver to 192.168.1.1 i wouldnt work. Still uses only 8.8.8.8. I had to add another host. Bug or feature?
Since my ISP modem has two dns servers assigned i only need one: 192.168.1.1

My second question.
When i resolve a host for ping it seems like it throws an error:
command: ping kth.se (a significant timeout before ping starts to echo answers)

Debug output:

Code: Select all

Lookup: {'query': '', 'domain': 'kth.se', 'src_addr': ('127.0.0.1', 60445), 'qtype': 1, 'qclass': 1}
Fetching IP Address for:  kth.se with NS Server: 192.168.1.1
* result:  [{'name': 'kth.se', 'data': '130.237.28.40', 'typename': 'A', 'classstr': 'IN', 'ttl': 60, 'type': 1, 'class': 1, 'rdlength': 4}]
Lookup: {'query': '', 'domain': '40.28.237.130.in-addr.arpa', 'src_addr': ('127.0.0.1', 45826), 'qtype': 12, 'qclass': 1}
Fetching IP Address for:  40.28.237.130.in-addr.arpa with NS Server: 192.168.1.1
* result:  [{'name': '40.28.237.130.in-addr.arpa', 'data': 'ns-vip-01.sys.kth.se', 'typename': 'PTR', 'classstr': 'IN', 'ttl': 500, 'type': 12, 'class': 1, 'rdlength': 22}]
Traceback (most recent call last):
  File "/home/qc/namedns/nmcontrol/lib/dnsServer/__init__.py", line 98, in serve
    resp_pkt = format_response(qid, question, qtype, qclass, rcode, an_resource_records, ns_resource_records, ar_resource_records)
  File "/home/qc/namedns/nmcontrol/lib/dnsServer/__init__.py", line 173, in format_response
    pkt += format_resource(resource, question)
  File "/home/qc/namedns/nmcontrol/lib/dnsServer/__init__.py", line 192, in format_resource
    r += struct.pack("!HHIH", resource['qtype'], resource['qclass'], resource['ttl'], len(resource['rdata']))
KeyError: 'rdata'
Lookup: {'query': '', 'domain': '40.28.237.130.in-addr.arpa', 'src_addr': ('127.0.0.1', 57841), 'qtype': 12, 'qclass': 1}
Fetching IP Address for:  40.28.237.130.in-addr.arpa with NS Server: 192.168.1.1
* result:  [{'name': '40.28.237.130.in-addr.arpa', 'data': 'ns-vip-01.sys.kth.se', 'typename': 'PTR', 'classstr': 'IN', 'ttl': 500, 'type': 12, 'class': 1, 'rdlength': 22}]
Traceback (most recent call last):
  File "/home/qc/namedns/nmcontrol/lib/dnsServer/__init__.py", line 98, in serve
    resp_pkt = format_response(qid, question, qtype, qclass, rcode, an_resource_records, ns_resource_records, ar_resource_records)
  File "/home/qc/namedns/nmcontrol/lib/dnsServer/__init__.py", line 173, in format_response
    pkt += format_resource(resource, question)
  File "/home/qc/namedns/nmcontrol/lib/dnsServer/__init__.py", line 192, in format_resource
    r += struct.pack("!HHIH", resource['qtype'], resource['qclass'], resource['ttl'], len(resource['rdata']))
KeyError: 'rdata'

biolizard89
Posts: 2001
Joined: Tue Jun 05, 2012 6:25 am
os: linux

Re: NMControl-Hyperion

Post by biolizard89 »

forth wrote:Newcomer (Have indulgence).

My first reaction to namecon as a .bit name resolver: Great idea! I love it as much as i love bitcoin. Now i have 12 namecoins. 8-)
Welcome!
forth wrote:But nmcontrol is a litle hard to set up. I whish it where more examples and explanation on how it works.
Yes, we need better documentation. This has been on the to-do list for a while, hopefully we'll get it dealt with soon.
forth wrote:Running on Ubunut 14.04 Workstation.

I use nmcontrol in front of my internet connection.

Startscript which places nmcontrol before the usual resolver. (namecoind already loaded)

Code: Select all

sudo sed -i 's/127.0.1.1/127.0.0.1/g' /etc/resolv.conf
sudo ./nmcontrol.py --dns.host=127.0.0.1 --dns.resolver=192.168.1.1,8.8.8.8 --daemon=0 --debug=1 start
My first question.
When i only set dns.resolver to 192.168.1.1 i wouldnt work. Still uses only 8.8.8.8. I had to add another host. Bug or feature?
That sounds like probably a bug, although I'm looking at the code now and I don't see why it would do that. https://github.com/namecoin/nmcontrol/b ... DNS.py#L19

We're planning to swap out the DNS library (changing from PyDNS to PyUnbound) in the near future, so there's a decent chance that it will be fixed when we do that.
forth wrote:Since my ISP modem has two dns servers assigned i only need one: 192.168.1.1

My second question.
When i resolve a host for ping it seems like it throws an error:
command: ping kth.se (a significant timeout before ping starts to echo answers)

Debug output:

Code: Select all

Lookup: {'query': '', 'domain': 'kth.se', 'src_addr': ('127.0.0.1', 60445), 'qtype': 1, 'qclass': 1}
Fetching IP Address for:  kth.se with NS Server: 192.168.1.1
* result:  [{'name': 'kth.se', 'data': '130.237.28.40', 'typename': 'A', 'classstr': 'IN', 'ttl': 60, 'type': 1, 'class': 1, 'rdlength': 4}]
Lookup: {'query': '', 'domain': '40.28.237.130.in-addr.arpa', 'src_addr': ('127.0.0.1', 45826), 'qtype': 12, 'qclass': 1}
Fetching IP Address for:  40.28.237.130.in-addr.arpa with NS Server: 192.168.1.1
* result:  [{'name': '40.28.237.130.in-addr.arpa', 'data': 'ns-vip-01.sys.kth.se', 'typename': 'PTR', 'classstr': 'IN', 'ttl': 500, 'type': 12, 'class': 1, 'rdlength': 22}]
Traceback (most recent call last):
  File "/home/qc/namedns/nmcontrol/lib/dnsServer/__init__.py", line 98, in serve
    resp_pkt = format_response(qid, question, qtype, qclass, rcode, an_resource_records, ns_resource_records, ar_resource_records)
  File "/home/qc/namedns/nmcontrol/lib/dnsServer/__init__.py", line 173, in format_response
    pkt += format_resource(resource, question)
  File "/home/qc/namedns/nmcontrol/lib/dnsServer/__init__.py", line 192, in format_resource
    r += struct.pack("!HHIH", resource['qtype'], resource['qclass'], resource['ttl'], len(resource['rdata']))
KeyError: 'rdata'
Lookup: {'query': '', 'domain': '40.28.237.130.in-addr.arpa', 'src_addr': ('127.0.0.1', 57841), 'qtype': 12, 'qclass': 1}
Fetching IP Address for:  40.28.237.130.in-addr.arpa with NS Server: 192.168.1.1
* result:  [{'name': '40.28.237.130.in-addr.arpa', 'data': 'ns-vip-01.sys.kth.se', 'typename': 'PTR', 'classstr': 'IN', 'ttl': 500, 'type': 12, 'class': 1, 'rdlength': 22}]
Traceback (most recent call last):
  File "/home/qc/namedns/nmcontrol/lib/dnsServer/__init__.py", line 98, in serve
    resp_pkt = format_response(qid, question, qtype, qclass, rcode, an_resource_records, ns_resource_records, ar_resource_records)
  File "/home/qc/namedns/nmcontrol/lib/dnsServer/__init__.py", line 173, in format_response
    pkt += format_resource(resource, question)
  File "/home/qc/namedns/nmcontrol/lib/dnsServer/__init__.py", line 192, in format_resource
    r += struct.pack("!HHIH", resource['qtype'], resource['qclass'], resource['ttl'], len(resource['rdata']))
KeyError: 'rdata'
Not sure on this one (I don't have the ability to test right now), but sounds like this may also be fixed (or at least changed) when we switch DNS libraries.
Jeremy Rand, Lead Namecoin Application Engineer
NameID: id/jeremy
DyName: Dynamic DNS update client for .bit domains.

Donations: BTC 1EcUWRa9H6ZuWPkF3BDj6k4k1vCgv41ab8 ; NMC NFqbaS7ReiQ9MBmsowwcDSmp4iDznjmEh5

forth
Posts: 2
Joined: Sun Mar 01, 2015 7:47 pm
os: linux
Location: Gothenburg, Sweden

Re: NMControl Configuration Ubuntu

Post by forth »

Ok, thanks for the reply.

I will follow the work and try to help when i have catched up.

Have a nice wekend

Post Reply