diff options
author | jim-p <jimp@pfsense.org> | 2010-11-10 16:48:11 -0500 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2010-11-10 16:48:11 -0500 |
commit | 0175ebf35fd2d35e56607e5e805c001ce443d826 (patch) | |
tree | 6fd0c363982adf5ea0bc21b2e45b8fa636152b0a /config | |
parent | 90b413bae3c32a5aff5ea2f45bcd0e01a16b7197 (diff) | |
download | pfsense-packages-0175ebf35fd2d35e56607e5e805c001ce443d826.tar.gz pfsense-packages-0175ebf35fd2d35e56607e5e805c001ce443d826.tar.bz2 pfsense-packages-0175ebf35fd2d35e56607e5e805c001ce443d826.zip |
Also allow the user to enter an IP:FQDN record for MX, since it's valid and tinydns will create an A record automatically when given both.
Diffstat (limited to 'config')
-rw-r--r-- | config/tinydns/tinydns.inc | 13 | ||||
-rw-r--r-- | config/tinydns/tinydns_domains.xml | 2 |
2 files changed, 12 insertions, 3 deletions
diff --git a/config/tinydns/tinydns.inc b/config/tinydns/tinydns.inc index dbfbd2a8..190a22cb 100644 --- a/config/tinydns/tinydns.inc +++ b/config/tinydns/tinydns.inc @@ -719,9 +719,18 @@ function tinydns_get_rowline_data($recordip, $recordtype, $ttl, $hostname, $rdns if(!$dist) $dist = "10"; // default to 10 if no preference has been defined. 0 is ugly. - // Check if we were given an IP, if so, put it in the ip field and leave the x field blank. + // Check if the user entered a custom record data with a : (for ip:host), and if it is valid, use it. + // If not, check if we were given an IP, if so, put it in the ip field and leave the x field blank. // Otherwise leave the IP blank and put in the hostname. - if (is_ipaddr($recordip)) + if (strpos($recordip, ':') !== false) { + list($rip, $rhost) = explode(':', $recordip); + if ((empty($rip) && is_hostname($rhost)) + || (empty($rhost) && is_ipaddr($rip)) + || (is_ipaddr($rip) && is_hostname($rhost))) + $record_string = $recordip; + else + break; // Don't add an invalid record. + } elseif (is_ipaddr($recordip)) $record_string = "{$recordip}:"; else $record_string = ":{$recordip}"; diff --git a/config/tinydns/tinydns_domains.xml b/config/tinydns/tinydns_domains.xml index d428d484..bf4de8fa 100644 --- a/config/tinydns/tinydns_domains.xml +++ b/config/tinydns/tinydns_domains.xml @@ -183,7 +183,7 @@ <field> <fielddescr>Record Data (FQDN, IP Address, or "raw" TinyDNS record)</fielddescr> <fieldname>ipaddress</fieldname> - <description>Enter the record data here. Use IP Address for A and PTR records. Use FQDN or Hostname for SOA and CNAME Records. NS Records use colon-separated IP and FQDN, e.g. 1.2.3.4:example.com</description> + <description>Enter the record data here. Use IP Address for A and PTR records. Use FQDN or Hostname for SOA and CNAME Records. MX records can be an IP, FQDN, or both separated by a colon, e.g. 1.2.3.4, mail.example.com, or 1.2.3.4:mail.example.com. NS Records use colon-separated IP and FQDN, e.g. 1.2.3.4:example.com</description> <type>input</type> <size>80</size> <required/> |