For DNS records that we resolve for, return nodata if we dont serve that data type

This commit is contained in:
Deon George 2023-11-17 22:03:00 +11:00
parent 509cdd7ea6
commit 3a0847f13a

View File

@ -232,12 +232,9 @@ final class DNS extends BaseProtocol
switch ($this->query->type) {
case self::DNS_TYPE_SRV:
if (! $ao->system->address)
return $this->nameerr();
Log::info(sprintf('%s:= Returning [%s] for DNS query [%s]',self::LOGKEY,$ao->system->address,$ao->ftn));
if ($xx=$ao->system->mailers->where('id',$mailer->id)->pop()) {
if (($ao->system->address) && ($xx=$ao->system->mailers->where('id',$mailer->id)->pop())) {
return $this->reply(
self::DNS_NOERROR,
[serialize([
@ -262,7 +259,7 @@ final class DNS extends BaseProtocol
Log::info(sprintf('%s:= Returning [%s] for DNS query [%s]',self::LOGKEY,$ao->system->address,$ao->ftn));
return (! $ao->system->address)
? $this->nameerr()
? $this->nodata()
: $this->reply(
self::DNS_NOERROR,
[serialize($this->domain_split($ao->system->address)) => self::DNS_TYPE_CNAME]);