Skip to main content

whmapi1 editzonerecord "+" character

Comments

2 comments

  • cPanelMichael
    whmapi1 editzonerecord domain='domain.com' line=26 name='domain.com.' class=IN ttl=14400 type=TXT txtdata='v=spf1 +a +mx +ip4:1.1.1.1 include:spf.domain.net ~all'

    Hello, You will need to encode the entry if you are using those characters. For example, here's an unencoded entry:
    v=spf1 +a +mx +ip4:1.1.1.1 include:spf.domain.net ~all
    Encoded, it looks like this:
    v%3Dspf1%20%2Ba%20%2Bmx%20%2Bip4%3A1.1.1.1%20include%3Aspf.domain.net%20~all
    I tested this with the following command and it worked properly:
    whmapi1 editzonerecord domain=cptest01.tld line=38 name=cptest01.tld. class=IN ttl=14400 type=TXT txtdata="v%3Dspf1%20%2Ba%20%2Bmx%20%2Bip4%3A1.1.1.1%20%2Binclude%3Aspf.domain.net%20~all" unencoded=1
    The updated entry in the zone includes the + symbols:
    # grep spf /var/named/cptest01.tld.db cptest01.tld. 14400 IN TXT "v=spf1 +a +mx +ip4:1.1.1.1 include:spf.domain.net ~all"
    Thank you.
    0
  • Haym
    Perfect, thanks for all of your help today @cPanelMichael! For anyone else reading, for clarification, the encoding is URL Encoding.
    0

Please sign in to leave a comment.