What's new

Custom domain for my home network @ RT-AC87U?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Keanu

Occasional Visitor
Hello guys,

so I was trying to setup a custom domain so that I'm able to access my devices, like a "qnap" box over "qnap.home". This was not working after setting "Domain Name" to "home" in the DHCP Server settings. So I flashed the merlin firmware on my RT-AC87U and hoped this would solve s.th. but no chance. I did a factory reset on the router but I still can't talk to my device over the domain.

[vagrant@localhost ~]$ dig qnap.home @192.168.1.1

; <<>> DiG 9.11.4-P2-RedHat-9.11.4-10.P2.fc28 <<>> qnap.home @192.168.1.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 23781
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;qnap.home. IN A

;; AUTHORITY SECTION:
. 65 IN SOA a.root-servers.net. nstld.verisign-grs.com. 2018112300 1800 900 604800 86400

;; Query time: 13 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Fri Nov 23 16:55:43 UTC 2018
;; MSG SIZE rcvd: 113


Any ideas? Do I need to set up dnsmasq manually on the router for this to work? What am I doing wrong?

Not all of the devices hang directly on the router. The router is connected to a switch and some of the devices to the switch, like "qnap". However this shouldn't matter right?

Kind regards
Keanu
 
It works for me without any special changes, beyond setting the domain name in the router's GUI.

The output of your dig command looks wrong. It looks like you are forwarding DNS requests to an upstream server rather than resolving them locally. Have you made non-default changes to DNS on the router? Are you using DNSFilter for example?
 
I didn't change DNS settings and I did a factory reset. I don't know what DNSFilter does. I noticed the following message in the logs after I restarted the dnsmasq service.

Nov 23 18:04:48 dnsmasq[1836]: warning: no upstream servers configured

/etc/resolv.conf of the router looks like this.

nameserver 62.2.24.158
nameserver 62.2.17.60
nameserver 62.2.24.162
nameserver 62.2.17.61


And /etc/dnsmasq.conf.

pid-file=/var/run/dnsmasq.pid
user=nobody
bind-dynamic
interface=br0
interface=pptp*
no-dhcp-interface=pptp*
no-resolv
servers-file=/tmp/resolv.dnsmasq
no-poll
no-negcache
cache-size=1500
min-port=4096
domain=home
expand-hosts
dhcp-range=lan,192.168.1.2,192.168.1.254,255.255.255.0,86400s
dhcp-option=lan,3,192.168.1.1
dhcp-option=lan,15,home
dhcp-option=lan,44,0.0.0.0
dhcp-option=lan,252,"\n"
dhcp-authoritative


Any ideas? I have only very basic DNS knowledge.
Shouldn't the IP of the router be inside /etc/resolv.conf?

Kind regards
Keanu
 
Last edited:
How have you inserted the host name "qnap" into router's DNS? Is the Qnap a DHCP client or have you created a "manual" entry for it on LAN > DHCP Server?
 
I just edited the Client List in Network Map over the Web UI. Is this enough?

EDIT:
And now I additionally added a manual entry in LAN > DHCP. The "qnap" box has a static IP of 192.168.1.22.
 
I already tried manually assigned IP addresses. It doesn't work.

[vagrant@localhost ~]$ dig qnap.home @192.168.1.1

; <<>> DiG 9.11.4-P2-RedHat-9.11.4-10.P2.fc28 <<>> qnap.home @192.168.1.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 60107
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;qnap.home. IN A

;; AUTHORITY SECTION:
. 373 IN SOA a.root-servers.net. nstld.verisign-grs.com. 2018112300 1800 900 604800 86400

;; Query time: 15 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Fri Nov 23 17:44:29 UTC 2018
;; MSG SIZE rcvd: 113

[vagrant@localhost ~]$ dig qnap @192.168.1.1

; <<>> DiG 9.11.4-P2-RedHat-9.11.4-10.P2.fc28 <<>> qnap @192.168.1.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 54861
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;qnap. IN A

;; AUTHORITY SECTION:
. 600 IN SOA a.root-servers.net. nstld.verisign-grs.com. 2018112300 1800 900 604800 86400

;; Query time: 21 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Fri Nov 23 17:44:50 UTC 2018
;; MSG SIZE rcvd: 108

λ nslookup qnap


Server: router.asus.com
Address: 192.168.1.1

*** router.asus.com can't find qnap: Non-existent domain

λ nslookup qnap.home

Server: router.asus.com
Address: 192.168.1.1

*** router.asus.com can't find qnap.home: Non-existent domain

And the dnsmasq.conf now.

keanu@RT-AC87U:/tmp/home/root# cat /etc/dnsmasq.conf
pid-file=/var/run/dnsmasq.pid
user=nobody
bind-dynamic
interface=br0
interface=pptp*
no-dhcp-interface=pptp*
no-resolv
servers-file=/tmp/resolv.dnsmasq
no-poll
no-negcache
cache-size=1500
min-port=4096
domain=home
expand-hosts
dhcp-range=lan,192.168.1.2,192.168.1.254,255.255.255.0,86400s
dhcp-option=lan,3,192.168.1.1
dhcp-option=lan,15,home
dhcp-option=lan,44,0.0.0.0
dhcp-option=lan,252,"\n"
dhcp-authoritative
dhcp-host=00:08:9B:E0:8D:02,192.168.1.22
dhcp-host=5C:E2:8C:61:69:98,192.168.1.2

 
Last edited:
Very strange. It looks like for some reason the router doesn't think it owns the "home" domain. Your dnsmasq.conf looks OK AFAICT because I'm not using the same firmware as you.

As an experiment could you change the domain name to "home.lan" and see if that make a difference.
 
Seems to stay the same.

[vagrant@localhost ~]$ dig qnap.home.lan @192.168.1.1

; <<>> DiG 9.11.4-P2-RedHat-9.11.4-10.P2.fc28 <<>> qnap.home.lan @192.168.1.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 8374
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;qnap.home.lan. IN A

;; AUTHORITY SECTION:
. 225 IN SOA a.root-servers.net. nstld.verisign-grs.com. 2018112300 1800 900 604800 86400

;; Query time: 13 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Fri Nov 23 18:01:20 UTC 2018
;; MSG SIZE rcvd: 117

keanu@RT-AC87U:/tmp/home/root# cat /etc/dnsmasq.conf
pid-file=/var/run/dnsmasq.pid
user=nobody
bind-dynamic
interface=br0
interface=pptp*
no-dhcp-interface=pptp*
no-resolv
servers-file=/tmp/resolv.dnsmasq
no-poll
no-negcache
cache-size=1500
min-port=4096
domain=home.lan
expand-hosts
dhcp-range=lan,192.168.1.2,192.168.1.254,255.255.255.0,86400s
dhcp-option=lan,3,192.168.1.1
dhcp-option=lan,15,home.lan
dhcp-option=lan,44,0.0.0.0
dhcp-option=lan,252,"\n"
dhcp-authoritative
dhcp-host=00:08:9B:E0:8D:02,192.168.1.22
dhcp-host=5C:E2:8C:61:69:98,192.168.1.2
 
Also, can you just double-check on the LAN > DHCP Server page that "Forward local domain queries to upstream DNS" is set to "No".
 
I don't have that option.

upload_2018-11-23_19-10-46.png
 
I don't have that option.
:eek: Ah, OK. I have been assuming that you were using Merlin's firmware as you said you had flashed that. Merlin's firmware also has an additional field on the DHCP page to set the host name (which is different from the Client Name).

P.S. You never answered my question, is the Qnap a DHCP client or is its network interface settings manually set?
 
Mhm... I am still of the opinion that I flashed the merlin firmware. I at least uploaded RT-AC87U_384.7_2.trx to the router :) So this didn't work? Okay...
Sorry, I missed the part where you asked me about qnap being the DHCP client. Yes, is one. The IP is not set manually on the host.
 
Mhm... I am still of the opinion that I flashed the merlin firmware. I at least uploaded RT-AC87U_384.7_2.trx to the router :) So this didn't work? Okay...
I'd be inclined to try and get Merlin working, if only because he has fixed a lot of these DNS-type issues.

Sorry, I missed the part where you asked me about qnap being the DHCP client. Yes, is one. The IP is not set manually on the host.
Thanks for the info. Probably not relevant at the moment but good to understand your setup.
 
Sorry, I missed the part where you asked me about qnap being the DHCP client. Yes, is one. The IP is not set manually on the host.
Just to explain a but further. When you reboot your router it forgets any DNS host names that were registered by DHCP clients. Therefore you need to also reboot the Qnap after the router has come back up. Normally this isn't an issue when the client is connected directly to the router because the physical link between the two goes down, forcing the client to re-register itself. Because your Qnap is connected to an intermediate switch it won't realise the router has rebooted, therefore requiring the client to be rebooted.
 
Now it works. Sorry for that one, I was really convinced the firmware uploaded OK.
qnap displays as static in the network map however, which is strange. I had to create a manual entry for it inside DHCP.

Thanks for your help!
 
Now it works. Sorry for that one, I was really convinced the firmware uploaded OK.
qnap displays as static in the network map however, which is strange. I had to create a manual entry for it inside DHCP.
That's good news. Probably best not to dwell on why it didn't work before :D. Network map is known to be a bit weird. As alluded to in my previous post, if you don't reboot your Qnap after the router it has no way of knowing that it is a DHCP client therefore it will assume it's static.
 
That's good news. Probably best not to dwell on why it didn't work before :D. Network map is known to be a bit weird. As alluded to in my previous post, if you don't reboot your Qnap after the router it has no way of knowing that it is a DHCP client therefore it will assume it's static.

can always go old-school with /etc/host(s)...

Hint - remove the () - had to add this due to a cloudflare warning...
 

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top