• Dear Pleskians! The Plesk Forum will be undergoing scheduled maintenance on Monday, 7th of July, at 9:00 AM UTC. The expected maintenance window is 2 hours.
    Thank you in advance for your patience and understanding on the matter.

Issue Unable to add an RFC-compatible SRV-record

mr-wolf

Silver Pleskian
Plesk Guru
According to https://tools.ietf.org/html/rfc6186

I should be able to create an SRV-record containing
Code:
_pop3._tcp     SRV  0 0 0   .

I can't do this using the CLI and not using the web-interface.
The target can't be empty and only ports from 1-65535 are valid (when in fact 0 is valid too)

I would like to create this record to discourage the use of POP3

Code:
/usr/local/psa/bin/dns --add ${DOMAIN} -srv "" -srv-priority 0 -srv-weight 0 -srv-port 0 -srv-protocol tcp -srv-service pop3 -srv-target-host ""
/usr/local/psa/bin/dns --add ${DOMAIN} -srv "" -srv-priority 0 -srv-weight 0 -srv-port 0 -srv-protocol tcp -srv-service pop3s -srv-target-host ""
/usr/local/psa/bin/dns --add ${DOMAIN} -srv "" -srv-priority 0 -srv-weight 0 -srv-port 0 -srv-protocol tcp -srv-service imap -srv-target-host ""

When SRV-records were introduced in Plesk they had a limitation that Protocol could only be TCP or UDP.
It took a long time before this was changed (4 years). I hope we don't have to wait for it that long this time.
 
What is your Plesk version?
Yes, target host can't be empty, but I successfully set port to 0 on Plesk 12.5 and Onyx with command like:

/usr/local/psa/bin/dns --add domain.com -srv "" -srv-priority 0 -srv-weight 0 -srv-port 0 -srv-protocol tcp -srv-service pop3 -srv-target-host 0.0.0.0
 
What is your Plesk version?
Yes, target host can't be empty, but I successfully set port to 0 on Plesk 12.5 and Onyx with command like:

/usr/local/psa/bin/dns --add domain.com -srv "" -srv-priority 0 -srv-weight 0 -srv-port 0 -srv-protocol tcp -srv-service pop3 -srv-target-host 0.0.0.0
Plesk 12.5

Thanks for giving me that workaround.

However,

According to the RFC the target host can be empty (well, not really empty as it will contain a dot). This parameter can't be given to the Plesk DNS command. Furthermore, I can't add a port 0 using the webinterface, but you're correct in that it works for the CLI.

I would really like both changed !!
It would enable me to follow RFC https://tools.ietf.org/html/rfc6186 and create records as suggested there:

This example is given in that RFC
Code:
_imap._tcp     SRV  0 0 0   .
_imaps._tcp    SRV  0 1 993 imap.example.com.
_pop3._tcp     SRV  0 0 0   .
_pop3s._tcp    SRV 10 1 995 pop3.example.com.

Code:
/usr/local/psa/bin/dns --add ${DOMAIN} -srv "" -srv-priority 0 -srv-weight 0 -srv-port 0 -srv-protocol tcp -srv-service pop3 -srv-target-host "0.0.0.0"
SUCCESS: Creation of DNS record in Domain 'xxx' complete.

/usr/local/psa/bin/dns --add ${DOMAIN} -srv "" -srv-priority 0 -srv-weight 0 -srv-port 0 -srv-protocol tcp -srv-service pop3 -srv-target-host "."
Incorrect DNS Record parameter values were specified

I just manually edited a zone-file in /var/named/run-root/var and replaced the "0.0.0.0." with a "." and bind had no problem with it.
I could use sed to change that, but I'd rather have it properly implemented in Plesk.

Code:
host -tSRV _pop3._tcp.${DOMAIN} localhost
Using domain server:
Name: localhost
Address: 127.0.0.1#53
Aliases:

_pop3._tcp.xxxx.xxx has SRV record 0 0 0 0.0.0.0.
sed -i 's/0 0 0 0\.0\.0\.0\.$/0 0 0 ./' /var/named/run-root/var/*.*
killall -HUP named
host -tSRV _pop3._tcp.${DOMAIN} localhost
Using domain server:
Name: localhost
Address: 127.0.0.1#53
Aliases:

_pop3._tcp.xxxx.xxx has SRV record 0 0 0 .
 
Last edited:
I made it a bit safer by only using sed on zone-files containing '0 0 0 0.0.0.0'
This way also date of the other zonefiles stay untouched.


Code:
  HEADLESS=
  tty >/dev/null || HEADLESS=true

  NAMED_FOLDER=/var/named/run-root/var/
  cd ${NAMED_FOLDER}
  MUTATION=                 # Maybe only records were deleted
  for FILE in *.* ; do
    if egrep -q '(pop|imap).*SRV.*0 0 0 0\.0\.0\.0\.$' "${FILE}" ; then
      MUTATION=true
      sed -i 's/0 0 0 0\.0\.0\.0\.$/0 0 0 ./' "${FILE}"
    fi
  done
  if [ ${MUTATION} ] ; then
    [ ${HEADLESS} ] || echo "Reconfiguring nameserver" >&2
    killall -HUP named
  fi
 
Last edited:
Back
Top