Add DNS changing

This commit is contained in:
jeanGaston 2023-10-27 11:04:01 +02:00 committed by GitHub
parent 452e027b49
commit a2cfcf7b19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,6 +6,19 @@ read -s -p "Administrator password: " admin_password
echo # To move to the next line
read -p "Active Directory domain name: " domain_name
# Prompt for DNS server IP and verify DNS resolution
while true; do
read -p "DNS server IP: " dns_server
if nslookup $domain_name $dns_server; then
break
else
echo "DNS resolution failed. Please enter a valid DNS server IP."
fi
done
# Change the DNS server settings in /etc/resolv.conf
echo "nameserver $dns_server" | sudo tee /etc/resolv.conf
# Install the necessary packages
apt -y install realmd sssd sssd-tools libnss-sss libpam-sss adcli samba-common-bin oddjob oddjob-mkhomedir packagekit