andrewtj/dnsxd — Issue #2: need to force host to have registration in wide area domain
Author: benoitc
Created: 2011-12-22 17:33:59+00:00
State: open

so I have setup a domain on my local machine listening on 127.0.0.1.3 and configured the global dynamic hostname acordingly on my machine. (cf steps below). Now starting refuge, wich register using following code :

register_service(Name) ->
case refuge_util:is_daemon(Name) of
true ->
Port = list_to_integer(get_port(Name)),
ServiceName = service_name(),
Type = case Name of
httpd -> "_http._tcp";
https -> "_https._tcp"
end,
{ok, Ref} = dnssd:register(ServiceName, Type, Port, [{path, "/"}]),
Ref;
false ->
nil
end.

With such code the service only register on .local but not on example.dev (tested using dns-sd).

But when I force an host name :

> dnssd:register(<<>>, <<"_http._tcp">>, 5984, <<>>, <<"benoitc">>, <<>>).

then I get

$ dns-sd -B _http example.dev
Browsing for _http._tcp.example.dev
Timestamp A/R Flags if Domain Service Type Instance Name
18:24:46.212 Add 2 0 example.dev. _http._tcp. Benoit’s MacBook Air

Tried to force rthe registration on the example.dev with Host=<<>> didn't fix that. Is this something expected?

Setup :
=====

What I did:
===========

1) Created a zone

$ ./bin/dnsxd-admin zone example.dev -c -e
$ ./bin/dnsxd-admin tsig example.dev -c admin -e admin

2) added needed hostname:

zone-bootstrap.txt

server localhost
zone example.dev
update delete ns.example.dev. A
update add ns.example.dev. 300 IN A 127.0.0.1
update delete example.dev. A
update add example.dev. 300 IN A 127.0.0.1
key admin.example.dev yY27ighuq00ruL6M+PXzbSrRePY=
show
send
answer

used nspupdate :

$ nsupdate zone-bootstrap.txt

3) boostrap dnssd

dnssd.txt :

server ns.example.dev
zone example.dev
update add _dns-update._tcp.example.dev 60 IN SRV 0 0 53 ns.example.dev
update add _dns-llq._udp.example.dev 60 IN SRV 0 0 53 ns.example.dev
update add _dns-update._udp.example.dev 60 IN SRV 0 0 53 ns.example.dev
update add b._dns-sd._udp.example.dev 60 PTR example.dev
update add db._dns-sd._udp.example.dev 60 PTR example.dev
update add r._dns-sd._udp.example.dev 60 PTR example.dev
update add dr._dns-sd._udp.example.dev 60 PTR example.dev
key admin.example.dev yY27ighuq00ruL6M+PXzbSrRePY=
show
send
answer

used nspupdate :

$ nsupdate zone-bootstrap.txt

4) Created a user:

$ ./bin/dnsxd-admin tsig example.dev -c benoitc -e benoitc --lock benoitc

5) Setup dynamic host