[Pdns-users] Internal DNS for .LAN Domain
David Jones
djones at ena.com
Mon Feb 24 02:40:07 UTC 2020
The “name” field must be the full hostname that ends with the domain name to be valid.
Here’s an example from a working zone:
MariaDB [powerdns]> select * from domains limit 1;
+----+------------+--------+------------+--------+-----------------+---------+-----+
| id | name | master | last_check | type | notified_serial | account | cas |
+----+------------+--------+------------+--------+-----------------+---------+-----+
| 1 | ha.ena.net | NULL | NULL | MASTER | 2019121901 | 2169 | |
+----+------------+--------+------------+--------+-----------------+---------+-----+
1 rows in set (0.00 sec)
MariaDB [powerdns]> select * from records where domain_id = 1 limit 5;
+----+-----------+--------------------+------+-------------+-------+------+-------------+-----------+------+----------+
| id | domain_id | name | type | content | ttl | prio | change_date | ordername | auth | disabled |
+----+-----------+--------------------+------+-------------+-------+------+-------------+-----------+------+----------+
| 2 | 1 | test.ha.ena.net | A | 1.2.3.4 | 300 | 0 | 1539287429 | NULL | 0 | 0 |
| 7 | 1 | ha.ena.net | NS | ns1.ena.net | 86400 | 0 | 1572025749 | NULL | 0 | 0 |
| 8 | 1 | ha.ena.net | NS | ns2.ena.net | 86400 | 0 | 1572025749 | NULL | 0 | 0 |
| 9 | 1 | tickets.ha.ena.net | A | 96.5.2.23 | 300 | 0 | 1539287429 | NULL | 0 | 0 |
| 10 | 1 | ldap.ha.ena.net | A | 96.4.2.38 | 300 | 0 | 1572025750 | NULL | 0 | 0 |
+----+-----------+--------------------+------+-------------+-------+------+-------------+-----------+------+----------+
5 rows in set (0.00 sec)
From: Pdns-users <pdns-users-bounces at mailman.powerdns.com> on behalf of Steven Christensen via Pdns-users <pdns-users at mailman.powerdns.com>
Reply-To: Steven Christensen <sdchristen at gmail.com>
Date: Sunday, February 23, 2020 at 5:42 PM
To: "pdns-users at mailman.powerdns.com" <pdns-users at mailman.powerdns.com>
Subject: [Pdns-users] Internal DNS for .LAN Domain
This isn't working... any ideas?
Added to database fine...
-------------------------------------------------
INSERT INTO domains (name, type) values ('1.168.192.in-addr.arpa', 'MASTER');
INSERT INTO domains (name, type) values ('lan', 'MASTER');
INSERT INTO records (domain_id, name, content, type,ttl,prio)
VALUES (1,'lan','localhost admin.example.com<http://admin.example.com> 1 10380 3600 604800 3600','SOA',86400,NULL);
INSERT INTO records (domain_id, name, content, type,ttl,prio)
VALUES (2,'1.168.192.in-addr.arpa','localhost admin.example.com<http://admin.example.com> 1 10380 3600 604800 3600','SOA',86400,NULL);
INSERT INTO records (domain_id, name, content, type,ttl,prio)
VALUES (1,'lan','localhost','NS',86400,NULL);
INSERT INTO records (domain_id, name, content, type,ttl,prio)
VALUES (2,'1.168.192.in-addr.arpa','localhost','NS',86400,NULL);
INSERT INTO records (domain_id, name, content, type,ttl,prio)
VALUES (1,'dns1','192.168.86.254','A',3600,NULL);
INSERT INTO records (domain_id, name, content, type,ttl,prio)
VALUES (2,'192.168.1.254','dns1','PTR',3600,NULL);
-----------------------------------------------------------------------------
[root at dns1 pdns]# nslookup
> server
Default server: 192.168.1.254
Address: 192.168.1.254#53
> 192.168.1.254
** server can't find 254.1.168.192.in-addr.arpa: NXDOMAIN
> dns1
Server: 192.168.1.254
Address: 192.168.1.254#53
** server can't find dns1: REFUSED
> dns1.lan
Server: 192.168.1.254
Address: 192.168.1.254#53
** server can't find dns1.lan: NXDOMAIN
> .lan
nslookup: '.lan' is not a legal name (empty label)
----------------------------------------------------------------------------------
/etc/hosts only has 127.0.0.1 localhost
/etc/resolv.conf only has server 192.168.1.254
----------------------------------------------------------------------------------
sort of works?
[root at dns1 pdns]# ping dns1.lan
PING dns1.lan(dns1.lan (fe80::4637:e6ff:fec4:a391%eno1)) 56 data bytes
64 bytes from dns1.lan (fe80::4637:e6ff:fec4:a391%eno1): icmp_seq=1 ttl=64 time=0.043 ms
64 bytes from dns1.lan (fe80::4637:e6ff:fec4:a391%eno1): icmp_seq=2 ttl=64 time=0.049 ms
64 bytes from dns1.lan (fe80::4637:e6ff:fec4:a391%eno1): icmp_seq=3 ttl=64 time=0.061 ms
-----------------------------------------------------------------
etc/pdns/pdns.conf
launch=gmysql
gmysql-host=localhost
gmysql-user=pdns
gmysql-password=XXXXX
gmysql-dbname=powerdns
master=yes
---------------------------------------------
firewall-cmd --add-service=dns --permanent
firewall-cmd --reload
-----------------------------------------------------------------
Anything else I can post that would help?
---------------------------------------------------------------
Thanks,
Steve
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.powerdns.com/pipermail/pdns-users/attachments/20200224/2d40c324/attachment-0001.htm>
More information about the Pdns-users
mailing list