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.
* http://ftsc.org/docs/fts-5004.001
*
* 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->query->type === self::DNS_TYPE_SRV) {
if ($labels->skip(1)->first() !== '_tcp')
return $this->reply(self::DNS_NAMEERR);
switch ($labels->first()) {
case '_binkp':
if ($labels->skip(1)->first() !== '_tcp')
return $this->reply(self::DNS_NAMEERR);
$labels->shift(2);
$mailer = Mailer::where('name','BINKP')->singleOrFail();
break;
case '_ifcico':
$mailer = Mailer::where('name','EMSI')->singleOrFail();
break;
default:
return $this->reply(self::DNS_NAMEERR);
}
$labels->shift(2);
}
// First check that it is a query we can answer
@ -242,8 +248,8 @@ final class DNS extends BaseProtocol
return $this->reply(
self::DNS_NOERROR,
[serialize([
0,
0,
0, // priority
1, // weight
$xx->pivot->port,
$this->domain_split($ao->system->address),
]) => 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-0048.002">FSC-0048</a></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
<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>
<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>
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>
syntax, including TXT and CNAME records</li>
</ul>
<h4>Other things</h4>