Add ifcico to DNS query responses

This commit is contained in:
Deon George 2023-10-05 15:23:49 +11:00
parent 0cabdcd3c1
commit 614d332fae
2 changed files with 16 additions and 9 deletions

View File

@ -12,6 +12,7 @@ use App\Models\{Address,Domain,Mailer};
/** /**
* Respond to DNS queries and provide addresses to FTN nodes. * Respond to DNS queries and provide addresses to FTN nodes.
* http://ftsc.org/docs/fts-5004.001
* *
* This implementation doesnt support EDNS nor DNSSEC. * This implementation doesnt support EDNS nor DNSSEC.
* *
@ -180,18 +181,23 @@ final class DNS extends BaseProtocol
// If this is a SRV record query // If this is a SRV record query
if ($this->query->type === self::DNS_TYPE_SRV) { if ($this->query->type === self::DNS_TYPE_SRV) {
switch ($labels->first()) {
case '_binkp':
if ($labels->skip(1)->first() !== '_tcp') if ($labels->skip(1)->first() !== '_tcp')
return $this->reply(self::DNS_NAMEERR); return $this->reply(self::DNS_NAMEERR);
$labels->shift(2); switch ($labels->first()) {
case '_binkp':
$mailer = Mailer::where('name','BINKP')->singleOrFail(); $mailer = Mailer::where('name','BINKP')->singleOrFail();
break; break;
case '_ifcico':
$mailer = Mailer::where('name','EMSI')->singleOrFail();
break;
default: default:
return $this->reply(self::DNS_NAMEERR); return $this->reply(self::DNS_NAMEERR);
} }
$labels->shift(2);
} }
// First check that it is a query we can answer // First check that it is a query we can answer
@ -242,8 +248,8 @@ final class DNS extends BaseProtocol
return $this->reply( return $this->reply(
self::DNS_NOERROR, self::DNS_NOERROR,
[serialize([ [serialize([
0, 0, // priority
0, 1, // weight
$xx->pivot->port, $xx->pivot->port,
$this->domain_split($ao->system->address), $this->domain_split($ao->system->address),
]) => self::DNS_TYPE_SRV]); ]) => self::DNS_TYPE_SRV]);

View File

@ -76,9 +76,10 @@
<a href="http://ftsc.org/docs/fsc-0045.001">FSC-0045</a>, <a href="http://ftsc.org/docs/fsc-0045.001">FSC-0045</a>,
<a href="http://ftsc.org/docs/fsc-0048.002">FSC-0048</a></li> <a href="http://ftsc.org/docs/fsc-0048.002">FSC-0048</a></li>
<li>Automatic delisting of idle nodes <sup>(to be implemented)</sup></li> <li>Automatic delisting of idle nodes <sup>(to be implemented)</sup></li>
<li>DNS server, to enable resolving of registered nodes using domain dns names <li>DNS server, to enable resolving of registered nodes using domain dns names <a href="http://ftsc.org/docs/fts-5004.001">FTS-5004</a>
<strong class="highlight">p<em>N</em>.f<em>N</em>.n<em>N</em>.z<em>N</em>.<em>domain</em>.ftn</strong>, or with <strong class="highlight">p<em>N</em>.f<em>N</em>.n<em>N</em>.z<em>N</em>.<em>domain</em>.ftn</strong>, or
<strong class="highlight">p<em>N</em>.f<em>N</em>.n<em>N</em>.z<em>N</em>.<em>[domain dns zone]</em></strong></li> <strong class="highlight">p<em>N</em>.f<em>N</em>.n<em>N</em>.z<em>N</em>.<em>[domain dns zone]</em></strong>
syntax, including TXT and CNAME records</li>
</ul> </ul>
<h4>Other things</h4> <h4>Other things</h4>