use static DNs in home network

hello ,
simple question:
I have home network and I have connet to it 2 sensors.
I’m trying to add dns entry for each sensor - so when I connect to my network and wnat to see sensor1
I will enter http://www. sensor1.com and not 10.0.0.109

this is what I did :

[admin@Home] > /ip dns cache all print 
Flags: S - static, N - negative 
 #   NAME TYPE  DATA                                       TTL         
 0 S ht.. A     10.0.0.109                                 1d          
 1 S 10.. PTR   http://www. sensor1.com                1d

but when I try to enter http://www. sensor1.com - I get no replay
when I enter 10.0.0109 - everything is working
what am I missing ?

I know its can be done , I remember did this before
do I need to edit another setting ?


Thanks,

URL: http://connect.com
Domain: connect.com

Enter only domains in the Domain Name Server (DNS)
www is a sub-domain of www.connect.com and normally the WWW server does this for you.

I hope I did not spoil your day with this. :wink:

still mot working
this is what I have

/ip dns static
add address=10.0.0.109 name=DavidSensor.com

when I enter 10.0.0.109 - I can see the sensor page
I have reboot the router and the computer to be sure

Does the PC have the Mikrotik’s IP address configured as the only DNS server, through static configuration or DHCP? If multiple DNS servers are configured, the PC only asks one of them; it only switches to the next address in the list if it gets no response at all, and if it switches, it sticks with that one as long as it is getting responses. A “hostname unknown” response is still a response, so reception of such one is not a reason to switch to next server.

I’m using the router connect to an ADSL modem
in the pppoe-out I mark use peer DNS

if I run

ipconfig /all

I see in the DNS Server from the ISP DNS

but isn’t the computer and all other dhco clients from the roouter first look at the dns static on the router?

what to do in order to make this work?

Thanks,

It depends on what IP address is set in dns-server item in the /ip dhcp-server network row. To let the clients use the Mikrotik as their DNS server, one of Mikrotik’s own addresses must be set there.

this is what I have

/ip dhcp-server network
add address=10.0.0.0/24 domain=DavidHome.Net gateway=10.0.0.1

change\edit it? , to what?
Thanks,

/ip dhcp-server network set [find gateway~“10.0.0.1”] dns-server=10.0.0.1

it working ,
thanks
small question :
when I connect My phone\tablet I see “!” near the wifi signal sign
everything is wotking I can go online and go to the sensor
why is it?
do I need to add anything else?
Thanks ,

You can not have space in DNS names, so www.sensor1.com should work. (this belongs to sensor-1.com)

If this is purely to access server on internal net, do use a name that does not belongs to someone else.
example sensor1.home

Great
Thanks !