Skip to content

Instantly share code, notes, and snippets.

@vandorjw
Last active September 7, 2017 15:44
Show Gist options
  • Select an option

  • Save vandorjw/10179860 to your computer and use it in GitHub Desktop.

Select an option

Save vandorjw/10179860 to your computer and use it in GitHub Desktop.
named config. This is can be used to add private records to a domain.
//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
options {
listen-on port 53 { localnets; };
listen-on-v6 port 53 { localnets; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
allow-query { localnets; };
allow-query-cache { localnets; };
recursion no; //default yes
dnssec-enable yes;
dnssec-validation yes;
dnssec-lookaside auto;
/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";
managed-keys-directory "/var/named/dynamic";
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
view "internal" {
/* This view will contain zones you want to serve only to "internal" clients
* that connect via your directly attached LAN interfaces - "localnets" .
*/
match-clients { localnets; };
recursion yes;
zone "." IN {
type hint;
file "/var/named/named.ca";
};
/* these are zones that contain definitions for all the localhost
* names and addresses, as recommended in RFC1912 - these names should
* not leak to the other nameservers:
*/
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
// These are our "authoritative" internal zones
zone "internal.mydomain.ca" {
type master;
file "db.internal.mydomain.ca";
};
zone "private.mydomain.ca" {
type master;
file "db.private.mydomain.ca";
};
zone "10.0.0.in-addr.arpa" {
type master;
file "db.10.0.0.in-addr.arpa";
};
};
//
// /var/named/db.internal.mydomain.ca
//
$TTL 1D
@ IN SOA internal.mydomain.ca. admin.mydomain.ca. 1 3H 15M 1W 1D
IN NS @
@ IN A 10.0.0.15
//
// /var/named/db.private.mydomain.ca
//
$TTL 1D
@ IN SOA private.mydomain.ca. admin.mydomain.ca. 1 3H 15M 1W 1D
IN NS @
@ IN A 10.0.0.16
//
// /var/named/db.10.0.0.in-addr.arpa
//
$TTL 1d
@ IN SOA internal.mydomain.ca. admin.mydomain.ca. 1 3H 15M 1W 1D
IN NS internal.mydomain.ca.
15 IN PTR internal.mydomain.ca.
16 IN PRT private.mydomain.ca.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment