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

Resolve domain name #7

Open
fazibear opened this issue May 15, 2019 · 1 comment
Open

Resolve domain name #7

fazibear opened this issue May 15, 2019 · 1 comment

Comments

@fazibear
Copy link
Contributor

fazibear commented May 15, 2019

When I'm start a server with following records:

[
  # create domain for an ip
  %Mdns.Server.Service{domain: "somedomain.local", data: :ip, ttl: 450, type: :a},

  # make service discoverable
  %Mdns.Server.Service{domain: "_services._dns-sd._udp.local",data: "_ssh._tcp.local",ttl: 4500, type: :ptr},

  # register ssh service
  %Mdns.Server.Service{domain: "_ssh._tcp.local",data: "SOME NAME._ssh._tcp.local",ttl: 4500, type: :ptr},

  # point service to our domain and port (22)
  %Mdns.Server.Service{domain: "SOME NAME._ssh._tcp.local",data: {0,0,22, 'somedomain.local'},ttl: 4500,type: :srv},

  # empty txt service (some tools expext that)
  %Mdns.Server.Service{domain: "SOME NAME._ssh._tcp.local",data: [],ttl: 4500,type: :txt})
] |> Enum.each(&Mdns.Server.add_service/1)

Tools like Avahi Discovery, Avahi SSH Server Browse, mdns-scan works fine.

But when I'm trying to find device with Mdns.Client the domain is nil.

After a little research this condition https://github.com/rosetta-home/mdns/blob/master/lib/mdns/server.ex#L106 prevent to send :a record witch Mdns.Client is looking for. On the other side other tools resolve domain correctly.

Should Mdns.Server always send :a record od Mds.Client should resolve domain in a different way?

@entone
Copy link
Contributor

entone commented May 15, 2019

I'm not sure, and haven't been using the library much, but I would love to resolve these issues.

Anyway you could provide a PR? I might be beneficial to fix it on both sides.

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

No branches or pull requests

2 participants