Giter VIP home page Giter VIP logo

uciaddns's Introduction

UCI AD DNS

Very simple utility to output uci commands for creating the minimum required AD records in dnsmasq on openwrt.

Usage

uciaddns SERVER REALM

Example

./uciaddns 192.168.1.5:53 my.home
uci add dhcp srvhost
uci set dhcp.@srvhost[-1].srv="_ldap._tcp.gc._msdcs.my.home"
uci set dhcp.@srvhost[-1].target="dc0.my.home."
uci set dhcp.@srvhost[-1].port="3268"
uci set dhcp.@srvhost[-1].class="100"
uci set dhcp.@srvhost[-1].weight="0"
uci commit dhcp
uci add dhcp srvhost
uci set dhcp.@srvhost[-1].srv="_ldap._tcp.my.home"
uci set dhcp.@srvhost[-1].target="dc0.my.home."
uci set dhcp.@srvhost[-1].port="389"
uci set dhcp.@srvhost[-1].class="100"
uci set dhcp.@srvhost[-1].weight="0"
uci commit dhcp
uci add dhcp srvhost
uci set dhcp.@srvhost[-1].srv="_ldap._tcp.pdc._msdcs.my.home"
uci set dhcp.@srvhost[-1].target="dc0.my.home."
uci set dhcp.@srvhost[-1].port="389"
uci set dhcp.@srvhost[-1].class="100"
uci set dhcp.@srvhost[-1].weight="0"
uci commit dhcp
uci add dhcp srvhost
uci set dhcp.@srvhost[-1].srv="_ldap._tcp.dc._msdcs.my.home"
uci set dhcp.@srvhost[-1].target="dc0.my.home."
uci set dhcp.@srvhost[-1].port="389"
uci set dhcp.@srvhost[-1].class="100"
uci set dhcp.@srvhost[-1].weight="0"
uci commit dhcp
uci add dhcp srvhost
uci set dhcp.@srvhost[-1].srv="_kerberos._tcp.dc._msdcs.my.home"
uci set dhcp.@srvhost[-1].target="dc0.my.home."
uci set dhcp.@srvhost[-1].port="88"
uci set dhcp.@srvhost[-1].class="100"
uci set dhcp.@srvhost[-1].weight="0"
uci commit dhcp
uci add_list dhcp.@dnsmasq[0].address="/gc._msdcs.my.home/192.168.1.5"
uci commit dhcp
/etc/init.d/dnsmasq restart

This is not everything needed for a complete AD DNS setup through openwrt.

For example, dc0 forward and reverse resolution must be working properly. If you're using an openwrt variant that uses kresd, configure reverse stub and forwarding. Here's how I did it for Turris Omnia.

customStubZones = policy.todnames({'1.168.192.in-addr.arpa', '1.168.192.in-addr.arpa.'})
policy.add(policy.suffix(policy.FLAGS({'NO_CACHE'}), customStubZones))
policy.add(policy.suffix(policy.STUB({'127.0.0.1@5353'}), customStubZones))
forwardZones = policy.todnames({'my.home'})
policy.add(policy.suffix(policy.FLAGS({'NO_CACHE'}), forwardZones))
policy.add(policy.suffix(policy.FORWARD({'127.0.0.1@5353'}), forwardZones)

Why?

While working on a go program that queried DNS records from a Samba DNS server, I discovered a bug in the golang dns module.

uciaddns's People

Contributors

h0tw1r3 avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.