3

MikroTik: Static DNS Entry

 1 year ago
source link: https://www.shellhacks.com/mikrotik-static-dns-entry/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

MikroTik: Static DNS Entry

A MikroTik router has a basic Domain Name System (DNS) server that allows to create static DNS entries.

This feature allows you to add your own entries to the MikroTik’s DNS server, which will be returned on requests with a higher priority.

This can be useful if, for example, you want to access some of your local devices by domain names instead of IP addresses, or if you want to redirect some outgoing DNS requests.

From this note you will find out how to create the static DNS entry on the MikroTik router from a command-line (terminal) or Winbox/Webfig.

Cool Tip: Set a static IP address for a MikroTik’s DHCP client! Read more →

Create Static DNS Entry on MikroTik

To create the static DNS entry, execute a command as follows:

[admin@MikroTik] > /ip dns static add address=<ipAddress> name=<domainName>
- example -
[admin@MikroTik] > /ip dns static add address=192.168.88.254 name=rpi.lan
[admin@MikroTik] > /ip dns static print
- sample output -
Columns: NAME, ADDRESS, TTL
# NAME        ADDRESS         TTL
;;; defconf
0 router.lan  192.168.88.1    1d
1 rpi.lan     192.168.88.254  1d

To create the static DNS entry, using Winbox/Winfig, go to “IP” → “DNS”, click on the “Static” button, then ➕ “Add”, set the static DNS entry and click “OK”:

xmikrotik-static-ip-dns_winbox-set-static-dns.png.pagespeed.ic.zdP2WC2LFX.png

Now check the response of the nslookup command from one of the devices connected to the MikroTik router:

C:\> nslookup rpi.lan
- sample output -
Server:  router.lan
Address:  192.168.88.1

Non-authoritative answer:
Name:    rpi.lan
Address:  192.168.88.254

Or simply ping the domain name to ensure that it points to the proper IP address.

C:\> ping rpi.lan
- sample output -
Pinging rpi.lan [192.168.88.254] with 32 bytes of data:
Reply from 192.168.88.254: bytes=32 time=1ms TTL=64
...

Cool Tip: Show devices connected to a MikroTik router! Read more →

Was it useful? Share this post with the world!

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK