Pages

Showing posts with label dns. Show all posts
Showing posts with label dns. Show all posts

MacOS append search-domain

I recently started using a Mac laptop (with MacOS Sierra) for work and one thing soon saw was that the search-domains were not appended when trying to use utilities such as ping or ssh (tough the configuration in the network preferences lists domain.com in the list of search-domains).

So, saying I have host1.domain.com using the following:
ping host1 would not resolve host1 (no search-domain appended)
ping host1.domain.com would resolve host1 (is specified in FQDN)
host host1 would resolve host1 (but that's because host uses its own resolver that is using the search-domain)

Looking for manual page of mDNSResponder - the system wide DNS resolver - this says:

 
OPTIONAL ARGUMENTS
     mDNSResponder accepts the following optional arguments:

     -AlwaysAppendSearchDomains
                                Append search domains for multi-labeled Par-
                                tially Qualified Domain Name as well as sin-
                                gle-labeled Partially Qualified Domain Name.
                                This argument is not recommended because of
                                the extra DNS traffic it generates and its
                                adverse effect on battery life.
..
     To cause mDNSResponder to run with these optional arguments when it
     launches on OS X 10.11 (El Capitan) and later, set the
     AlwaysAppendSearchDomains or NoMulticastAdvertisements boolean keys to
     true in /Library/Preferences/com.apple.mDNSResponder.plist and reboot.

If you're a newb like me on MacOS, the next question is "how do I set the boolean key to true for AlwaysAppendSearchDomains? ". I found the answer here:

sudo defaults write /Library/Preferences/com.apple.mDNSResponder.plist AlwaysAppendSearchDomains -bool YES

Then, as the manual says, reboot. Bouncing the mDNSResponder would probably also work.

DDNS and QNAP NAS

I was looking recently to allow remote access into my home QNAP NAS from remote locations.
My IP address at home is dynamic so I needed a DDNS provider and some port forwarding on the home router.
My setup at home is simple. My internet connection is over a DSL line. I have a DSL router from the ISP serving as an Wifi access point for my devices at home. It also has 4 ethernet ports and to one of them I have my QNAP NAS connected.

After looking throgh a few reviews on the internet, I choosed DuckDNS. What i liked about it the most is their variety support in operating systems and the way the dynamic update is done - through an HTTPS GET request (can use also HTTP GET, but HTTPS is recommended). Secure and implemented in any decent OS. Full specs here.
You log in with one account from various social networks (reddit, G+, facebook, twitter) and you get a token assigned with your account. Further, at this time you can use 5 subdomains.

The QNAP itself can act as a DDNS client for a few providers. The whole list is below. Duckdns is not one of them.


To make use of duckdns on the QNAP NAS I've added in the /etc/config/crontab file an entry to update my IP every 2 hours:
 0 */2 * * * /share/Valentin/duckdns/duck.sh >/dev/null 2>&1