Sunday, September 15, 2019

Updating FreeIPA's DNS from DHCP

Updating FreeIPA’s DNS from DHCP

My next thing is to switch deepthot over to freeIpa’s dns.
  1. Look around freeipa to make sure it’s set up
  2. Give permissions to the dhcp on services.deepthot to use it
  3. Edit the dhcp to switch the domain, dns, and which dns to update.
  4. Restart dhcp and hope for the best
Checked out IPA. It was down, trying to recover. This was probably due to me mucking about with the IP. Yes, the ip was still in the hosts file, changed it to the current IP and it came right up. Better check the other machines to see if it’s in the hosts file. Only place was the laptop and it was already fixed.
Poked around the IPA DNS. Looks ok. I’m going to test it now. Won’t work for internal addresses, obviously, but should for external ones.
I need to investigate this. I did notice that when I switched to the configuration on the laptop that was using ipa for dns all of my ssh sessions froze. So something more could be going on there. Perhaps I should just edit /etc/resolv.conf by hand and see if I still have a problem.
On ipa:
[root@ipa ~]# dig ipa.deepthot.aa @192.168.42.4

; <<>> DiG 9.9.4-RedHat-9.9.4-74.el7_6.2 <<>> ipa.deepthot.aa @192.168.42.4
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 65502
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;ipa.deepthot.aa.  IN A

;; ANSWER SECTION:
ipa.deepthot.aa. 1200 IN A 192.168.42.4

;; AUTHORITY SECTION:
deepthot.aa.  86400 IN NS ipa.deepthot.aa.

;; Query time: 0 msec
;; SERVER: 192.168.42.4#53(192.168.42.4)
;; WHEN: Sat Sep 14 08:23:24 MST 2019
;; MSG SIZE  rcvd: 74
However on my laptop:
denebeim@frankiemouse:~$ dig ipa.deepthot.aa @192.168.42.4

; <<>> DiG 9.11.3-1ubuntu1.9-Ubuntu <<>> ipa.deepthot.aa @192.168.42.4
;; global options: +cmd
;; connection timed out; no servers could be reached
So, something isn’t right. Researching freeipa dns… I didn’t see anything funky, however, looks like the firewall wasn’t allowing DNS. (do I want a firewall on my internal lan?)
Big question: Do I want deepthot.aa or should I just do int.deepthot.org for the internal lan? That seems to be what freeipa is telling me and they may be right. It says DNSSEC is way better if you do this. Also, one step is to probably take over my DNS master. I need to figure out how to get dreamhost to just be a secondary. I miss having control of my DNS.
And the answer was, in fact, the firewall. I fixed it for the time being with firewall-cmd --permanent --add-service dns;firewall-cmd --reload

Configure DHCP with FreeIPA

According to freeipa DDNS configuration as far as ipa is concerned you just have to grant dhcpupdate wildcard * ANY; to the Bind update policy section of the DNS zone settings.
I edited dhcpd.conf to use deepthot.aa as the domain, reset the nameserver to ns.deepthot.aa, reset the primary on the zones to 192.168.42.4
< option domain-name "deepthot";
< option domain-name-servers ns.deepthot;
---
> option domain-name "deepthot.aa";
> option domain-name-servers ns.deepthot.aa;
120c120
< #update-static-leases on;
---
> update-static-leases on;
126c126
<             primary 192.168.42.2;
---
>             primary 192.168.42.4;
130c130
<             primary 192.168.42.2;
---
>             primary 192.168.42.4;
Nothing really came out in the logs. It didn’t appear to work. Tried adding a ns CNAME ipa to the ipa dns. I can’t seem to look it up anywhere. None of the updates are happening in IPA.
Kinda stuck at the moment. Going to take a break.
I did find something, a couple of things, first adding records to freeipa doesn’t show up immediately, obviously because of caching. In bionic you clear the dns cache with systemd-resolve --flush-caches Oddly enough changing dns in freeipa does not show up immediately even on the freeipa box. That kinda sucks You need to do killall -HUP named-pkcs11
I figured out what the problem was, in fact you can see it in that diff above, or not see it. The problem was that the dns zone wasn’t updated from deepthot to deepthot.aa. Here’s where the networks are declared:
subnet 192.168.42.0 netmask 255.255.255.0 {
       authoritative;
       range 192.168.42.100 192.168.42.254;
       zone 42.168.192.in-addr.arpa. {
            primary 192.168.42.4;
     key dhcpupdate;
     }
       zone deepthot.aa. {
            primary 192.168.42.4;
     key dhcpupdate;
     }
}

No comments:

Post a Comment

How Simple Does It Have to Be Before It’s Mine?

 Hi, Joy here, I'm tired.  I'm too tired to polish this.  However bare with me, the text below is *trying* to be me.  It's not l...