I’m getting ready to have an integrated environment on my server. I have a Windows domain controller up and running and I’m about to get my CentOS 7 join the domain.
Before I can go on, CentOS 7 needs to be able to communicate with the DNS server that I created on the Windows Server Core. The IP address of the DNS server in my network is 192.168.1.26. And the domain name is homenet.iriumi.ad.
A DNS server can have multiple zones. Let’s see what kind of zones I have by executing the following command.
I have the following zones on my DNS server.
Now let’s see what DNS ANAMEs we have.
$ Get-DnsServerResourceRecord -ZoneName "homenet.iriumi.ad"
It gives you the list of DNS entries in the zone. I have a CentOS 7 host that I have assigned a static IP address to and I’m going to make sure I can resolve it.
$ Add-DnsServerResourceRecordA -ZoneName "homenet.iriumi.ad" -AllowUpdateAny -Name "dockerhost01" -IPv4Address "192.168.1.27"
By executing the command above, as long as a machine can talk to the DNS server, it can resolve dockerhost01.homenet.iriumi.ad to 192.168.1.27. In other words, dockerhost01.homenet.iriumi.ad is mapped to 192.168.1.27.
If necessary, you can remove the DNS entry by executing the following command.
$ Remove-DnsServerResourceRecord -ZoneName "homenet.iriumi.ad" -RRType "A" -Name "dockerhost01"
Next, I’m going to ssh into my CentOS 7 VM and then configure it so that it asks the DNS server on Windows Server Core to resolve names.
# vi /etc/sysconfig/network-script/ifcfg-[your network interface]
In the text file, add the following entry. Change the IP address and the domain name to fit your environment, obviously.
DNS1=192.168.1.26 DNS2=220.127.116.11 DNS3=18.104.22.168 DOMAIN=homenet.iriumi.ad
I have DNS1 point to my Windows Server Core with DNS server. And DNS2 and DNS3 are pointing to OpenDNS. Save and get out by :wq in vi.
Restart the network by executing the following command.
# systemctl restart network
Once that’s done, the system writes these data in
/etc/resolv.conf. Check it by executing the following command.
# cat /etc/resolv.conf
Now try pinging dockerhost01.homenet.iriumi.ad and the IP address is resolved and get a response.
Now we are ready to get this host to join the Windows domain!