Environment I'm using:
Red Hat Enterprise Linux 7.4
Virtualbox
I've installed all the required packages:
yum -y install ipa-server bind-dyndb-ldap ipa-server-dns
Added the following in my /etc/hosts:
192.168.1.1 labipa.example.com labipa
Install FreeIPA with DNS:
ipa-server-install --setup-dns --allow-zone-overlap
Server host name: labipa.example.com
Directory Manager password: ~~password~~
IPA admin password: ~~password~~
Enter IP address for a DNS forwarder: 8.8.8.8
Do you want to search for missing reverse zones? yes
[37/45]: initializing group membership
[error] NetworkError: cannot connect to 'ldap://labipa.example.com:389':
ipa.ipapython.install.cli.install_tool(CompatServerMasterInstall): ERROR cannot connect to
'ldap://labipa.example.com:389':
ipa.ipapython.install.cli.install_tool(CompatServerMasterInstall): ERROR The ipa-server-install command
failed. See /var/log/ipaserver-install.log for more information
Steps I've tried to fix:
firewall-cmd --permanent --add-service=ldap
firewall-cmd --reload
Best Answer
The installation asks you for a DNS forwarder, which it presumably then uses to resolve any DNS lookups.
Because you've specified 8.8.8.8, it won't be able to work out that labipa.example.com points to your machine.
You can install something like dnsmasq, and have it read your /etc/hosts entry, and then tell the freeipa installer to use 127.0.0.1 as your DNS forwarder.
Here is a RedHat guide on doing exactly this. It requires a RedHat support account (but you are using RedHat, so probably have an account). There is a similar solution on stackexchange too