Possibility to integrate nmcontrol DNS into Avahi / unixOS ?

Namecoin, NMControl
Post Reply
khal
Site Admin
Posts: 708
Joined: Mon May 09, 2011 5:09 pm
os: linux

Possibility to integrate nmcontrol DNS into Avahi / unixOS ?

Post by khal »

Every unix has an equivalent of the file /etc/nsswitch.conf which contains informations on how to resolve names.

Default config may be :

Code: Select all

hosts:          files dns
=> On debian, it will search in /etc/hosts and then in /etc/resolv.conf (list of dns servers)

If you install the avahi daemon, the config is updated to :

Code: Select all

hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4
=> avahi will now reply using "mdns4_minimal" before DNS servers, and using "mdns4" after DNS servers (if I understand well).

Avahi proposes an API to register services, which is available in C, D-BUS, etc.

For example, it could be used in python (with the python-dbus packages or even the python-avahi package) and be integrated into nmcontrol.

I don't know enough about avahi to know if is would be possible to register nmcontrol as a dns service for .bit, but it can be an interesting way for a better integration under linux.

Anybody knows more about avahi and its possibilities ?

Edit: some avahi usages, to broadcast services :
- http://stackoverflow.com/questions/3430 ... ent-server
- http://stackp.online.fr/?p=35

Edit2: avahi is used under linux to broadcast your local hostname on the network, so, people can contact you with the hostname <computer-name>.local on your network by using multi-cast dns.

Edit3 : avahi-daemon.conf

Code: Select all

#publish-dns-servers=192.168.50.1, 192.168.50.2
#publish-resolv-conf-dns-servers=yes
It should be possible to use a local dns server listening on 127.0.0.2 by configuring it there, but nothing is automatic.

Edit4 : avahi-dnsconfd :

Code: Select all

 This tool listens on the network for announced DNS servers and passes them
 to resolvconf so it can use them. This is very useful on autoconfigured
 IPv6 networks.
Note : such DNS servers may only by called by mdns and not mdns_minimal, so too late for us.

Edit5 : avahi seems mainly targeted on hostnames and not on networks/zones. I still search a bit.

Edit6 : this python script register another alias (CNAME) for your computer.
Would it be possible to register the "bit" domain with a NS record set to 127.0.0.2 (default nmcontrol dns server ip) ?
NamecoinID: id/khal
GPG : 9CC5B92E965D69A9
NMC: N1KHAL5C1CRzy58NdJwp1tbLze3XrkFxx9
BTC: 1KHAL8bUjnkMRMg9yd2dNrYnJgZGH8Nj6T

Register Namecoin domains with BTC
My bitcoin Identity - Send messages to bitcoin users
Charity Ad - Make a good deed without paying a cent

domob
Posts: 1129
Joined: Mon Jun 24, 2013 11:27 am
Contact:

Re: Possibility to integrate nmcontrol DNS into Avahi / unix

Post by domob »

That's a very interesting idea! Unfortunately, I don't know anything about Avahi or the host resolution procedures on GNU/Linux myself, so I can't give advice. But it looks promising. Could this be even used for .bit support on rooted Android devices, for instance?

EDIT: I just checked my device (Cyanogenmod) and it has /etc/hosts but neiter /etc/nsswitch.conf nor even /etc/resolv.conf.
BTC: 1domobKsPZ5cWk2kXssD8p8ES1qffGUCm | NMC: NCdomobcmcmVdxC5yxMitojQ4tvAtv99pY
BM-GtQnWM3vcdorfqpKXsmfHQ4rVYPG5pKS
Use your Namecoin identity as OpenID: https://nameid.org/

khal
Site Admin
Posts: 708
Joined: Mon May 09, 2011 5:09 pm
os: linux

Re: Possibility to integrate nmcontrol DNS into Avahi / unix

Post by khal »

domob wrote:That's a very interesting idea! Unfortunately, I don't know anything about Avahi or the host resolution procedures on GNU/Linux myself, so I can't give advice. But it looks promising. Could this be even used for .bit support on rooted Android devices, for instance?

EDIT: I just checked my device (Cyanogenmod) and it has /etc/hosts but neiter /etc/nsswitch.conf nor even /etc/resolv.conf.
Wikipedia also speaks about /etc/svc.conf
But, if Cyanogenmod provides the avahi-daemon with the .local feature, it may be sufficient I guess (network config can be in /etc/network/ maybe).

Added edit6 :
khal wrote:Edit6 : this python script register another alias (CNAME) for your computer.
Would it be possible to register the "bit" domain with a NS record set to 127.0.0.2 (default nmcontrol dns server ip) ?
Other url : http://stackoverflow.com/questions/7752 ... using-mdns
That way, .bit request would be forwarded to the nmcontrol dns server. Or will that register the domain bit.local instead ? :p

Edit : I tested the python script, and every alias not ending by .local thow an error.

Edit2 : Alias test.local2 was accepted by changing avahi conf to :

Code: Select all

[wide-area]
#enable-wide-area=yes
enable-wide-area=no
But no possibility to test, even the .local dos not work. Maybe avahi need some time after a restart.

Edit3 : no success yet, any volunteer ? :p
NamecoinID: id/khal
GPG : 9CC5B92E965D69A9
NMC: N1KHAL5C1CRzy58NdJwp1tbLze3XrkFxx9
BTC: 1KHAL8bUjnkMRMg9yd2dNrYnJgZGH8Nj6T

Register Namecoin domains with BTC
My bitcoin Identity - Send messages to bitcoin users
Charity Ad - Make a good deed without paying a cent

Post Reply