using ona with dnsmasq running on a debian system

robfantini edited this page Oct 22, 2016 · 13 revisions

part 1 on dnsmasq server

mkdir -p  /fbc/dns
mkdir -p /fbc/bin
  • add to dnsmasq.conf
addn-hosts=hosts.extra  #  use full pathname

fbc = federation business computing

part 2 at the system running ona

  • create /opt/ona/sql/simplehosts.sql
select INET_NTOA(i.ip_addr) ip,
       concat(,".", fqdn," # ",i.mac_addr mac,
       concat(" ",," ",," (",,")") device_type 
from   interfaces i,
       domains z,
       subnets s,
       manufacturers m,
where  i.host_id =
and    dns.domain_id =
and    dns.interface_id =
and    dns.type like 'A'
and = i.subnet_id
and = hosts.device_id
and    models.manufacturer_id =
and    device_types.model_id =
and    device_types.role_id =
and    devices.device_type_id =
order by i.ip_addr
  • make a new hosts file.
/opt/ona/bin/ -r ona_sql sql=simplehosts.sql |  \ 
sed -e "s/\:/      /" -e "s/://g" > /root/

Then i use a script to see if the file changed, if so scp to dnsmasq server, and restart/reload service.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.