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

NSEC records with parameter Types #27

Closed
victorkani opened this issue Aug 17, 2018 · 7 comments
Closed

NSEC records with parameter Types #27

victorkani opened this issue Aug 17, 2018 · 7 comments

Comments

@victorkani
Copy link

How to send answer of Record type NSEC with types TXT and SRV.

Something like this , I found this in ARSoft.Tools.Net
public NSecRecord(string name, RecordClass recordClass, int timeToLive, string nextDomainName, List types): base(name, RecordType.NSec, recordClass, timeToLive)
{
}

@richardschneider
Copy link
Owner

richardschneider commented Aug 17, 2018

You can add any DNS Resource Record to ServiceProfile.Resources. Then, when the Resource Record is asked for, it will be sent.

var service = new ServiceProfile("x1", "_xservice._tcp", 5011);
service.Resources.Add(new NSecRecord { ... } );
var sd = new ServiceDiscovery();
sd.Advertise(servuce));

@richardschneider
Copy link
Owner

richardschneider commented Aug 17, 2018

The NSecRecord can be created as

new NSecRecord 
{
   NextOwnerName = "...",
   TypeBitmaps = ...
}

@richardschneider
Copy link
Owner

@victorkani Does the above answers your question?

@victorkani
Copy link
Author

How to return the following records to google discovery service ?

The following records should be returned by the server in an authoritative response:
Two NSEC records, the first for the name {friendlyName}._googlecast._tcp.local with types TXT and SRV, the second for name {friendlyName}.local with type A. Where {friendlyName}is the display name of the device

                        res.AdditionalRecords.Add(new NSECRecord()
                        {
                            Name = "victor." + service,
                            Type = DnsType.TXT,
                            NextOwnerName = "1.victor.local",

                        });

The above is the syntax for sending NSEC record information, but the Type parameter is not of array type to set both TXT and SRV.

@richardschneider
Copy link
Owner

richardschneider commented Aug 20, 2018

I'm just making a change to Makaretu.Dns to make NSECRecord friendlier, see richardschneider/net-dns#17. In the current design you need to set TypesBitmap which is byte array and way unfriendly.

In the new design

new NSECRecord()
{
      Name = "victor." + service,
      Types = { DnsType.TXT, DnsType.SRV },
      NextOwnerName = "1.victor.local"
}

I'll have a release in a few hours and will ping you.

@richardschneider
Copy link
Owner

The new NSECRecord is available in release v0.12.0

Hope it helps!

@richardschneider
Copy link
Owner

@victorkani Are you ready to close this issue?

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