use correct domain names when registering static DHCP entries in DNS

When registering static DHCP entries in DNS, we first try to use the domain name configured for the static entry (if any), then the domain name configured in the DHCP server settings for the corresponding interface (if any), and as a last resort the system domain name.

This change was proposed by user TechSmurf on the pfSense boards; see <http://forum.pfsense.org/index.php/topic,64934.msg352331.html#msg352331>.
Merge pull request #746 from razzfazz/dhcp-domain-releng-2-1

use correct domain names when registering static DHCP entries in DNS
Check if hostname is valid, it fixes #3117
Catch adaX here too