Community discussions

MikroTik App
 
MikroManagement
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 64
Joined: Thu Feb 09, 2006 2:41 pm
Location: Pretoria

DHCP Leases to DNS

Wed Jul 26, 2006 2:12 pm

MikroTik router configured as both DNS & DHCP server.

6 Interfaces (subnets) used, would like to enable computers on different subnets to access eachother on pc-name / pc-name.localdomain.

Way to get DHCP leases to DNS static table? I have tried without any luck. IP addresses works 100%, DNS doesn't resolve names.

Any help appreciated. Im running v2.9.7
 
MikroManagement
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 64
Joined: Thu Feb 09, 2006 2:41 pm
Location: Pretoria

Thu Jul 27, 2006 7:05 pm

Possible to iterate through all leases to populate in DNS?
 
User avatar
Hammy
Forum Veteran
Forum Veteran
Posts: 776
Joined: Fri May 28, 2004 5:53 pm
Location: DeKalb, IL
Contact:

Fri Jul 28, 2006 12:52 am

I think I've asked for this before, but I believe I couldn't get MT to understand what I was talking about...
 
User avatar
BrianHiggins
Forum Veteran
Forum Veteran
Posts: 720
Joined: Mon Jan 16, 2006 6:07 am
Location: Norwalk, CT
Contact:

Thu Aug 03, 2006 4:37 pm

many DHCP servers have an option to register the DHCP lease in DNS. I think there is even an official meathod for the DHCP client to request the DNS server register the system in DNS...
 
pedja
Long time Member
Long time Member
Posts: 684
Joined: Sat Feb 26, 2005 5:37 am

Fri Aug 04, 2006 9:45 am

MT shuld do this without scripting. We asked it several times, but no help.
 
pedja
Long time Member
Long time Member
Posts: 684
Joined: Sat Feb 26, 2005 5:37 am

Wed Sep 20, 2006 3:38 pm

As i needed this funcion I just worte a script that does the job:
:set topdomain "yourdomain.com" ; 
/ip dhcp-server lease ;
:foreach i in=[find] \
do={  \
    /ip dhcp-server lease ;
        :if ([:len [get $i host-name]] > 0) do={ \
           :set hostname ([get $i host-name] . "." . $topdomain); \
           :set hostip [get $i address]; \
           :put ( $hostname . " : " . $hostip ) ; \
           /ip dns static ;
           :foreach di in [find] do = { :if ([get $di name] = $hostname) do {/ip dns static remove $di }} 
           /ip dns static add name=$hostname address=$hostip
         }  \
};
Run this in scheduler and it will add static dns entry for each DHCP lease.
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6263
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Wed Sep 20, 2006 4:09 pm

could be fine if that could be done on event that lease is assigned.

if logging is enabled, then any lease that gets assignes is logged, so maybe it could be done that way?

just a thought
 
pedja
Long time Member
Long time Member
Posts: 684
Joined: Sat Feb 26, 2005 5:37 am

Wed Sep 20, 2006 4:25 pm

I agre, and alreadu submited request for developers to add some events so we can attach scripts to be executed when something happens.

Until then, we have to it in hard way, set trigers and repeat scripts inintervals...

After all this DHCP issue shuold be solved by MT itself, without need for such script.

Who is online

Users browsing this forum: No registered users and 19 guests