Can I use single word to resolve to IP address with Static DNS?

I’d like to use a single word to resolve to an internal IP address eg nas → 10.1.1.10.
Using static DNS I’ve found I need to add a period to the word eg nas. → 10.1.1.10.

Is this normal in Router OS? Is there a way I can use just the word without the period or other character?

Hi johnt107, yes as far as I know this is normal behaviour in RouterOS. You can read more about this here https://wiki.mikrotik.com/wiki/Manual:IP/DNS

DNS specifies that a “full” name ends up in the top domain, which is “.” (yes, a dot).

If you ask for a domain that does not end in a dot the typical resolver will search for it with some kind of “default” domain appended.

This default domain can come from several places, depending of the resolver: a DHCP/PPPOE/LTE… option, configuration … I think routerboard’s resolver does not support it.

I see on 7.1 Beta 2 I can use relative names:

/ip/dns/static/add name=nas address=192.168.88.2
# 43 ms away because it is a VPN away from here
[admin@MT] > :ping nas
  SEQ HOST                                     SIZE TTL TIME  STATUS                                                               
    0 192.168.88.2                             56  63 43ms 
    1 192.168.88.2                             56  63 43ms

If you have some “default-domain” option set you might see different results

It’s not RouterOS. If client asks for “nas”, RouterOS will be happy to answer. Problem is, client is probably asking for nas., as described in previous post. You can set that domain for LAN in DHCP server, then add static addresses under this domain, and it will work, because client will be asking for them.

I now see that the issue is with Windows (10). When I use nslookup within cmd it resolves nas. When I try to ping or tracert it in cmd it comes back with “Ping request could not find host nas.” for ping or “Unable to resolve target system name nas.” for tracert. I suppose that’s why it doesn’t work in a browser either. Any way to get around this? I looked at Mikrotik DNS logs and didn’t see any query come through for “nas” though I could see queries for “nas.” . I’ve not had much luck searching info on this.

Watch the difference:

Microsoft Windows [Version 10.0.18363.1082]
(c) 2019 Microsoft Corporation. Wszelkie prawa zastrzeżone.

d:>nslookup
Default Server: router.mypreciousdomain.pl
Address: 10.254.254.254

google.com > > ← no dot there
Server: router.mypreciousdomain.pl
Address: 10.254.254.254

Non-authoritative answer:
Name: > google.com> .mypreciousdomain.pl
Address: 191.14.29.149

google.com> . > ← dot there
Server: router.mypreciousdomain.pl
Address: 10.254.254.254

Non-authoritative answer:
Name: > google.com > ← no local domain where are you asking from
Addresses: 2a00:1450:4016:803::200e
172.217.23.46

quit