#-------------------------------------------------------------------------
## resolv.conf pour EOLE
#-------------------------------------------------------------------------
# vi:syntax=conf
%if not %%getVar('_minimal_mode', False)
# level:full

# For eole-ad
    %if %%getVar('ad_rescue', None)
nameserver %%ad_rescue
    %end if
    %if %%getVar('ad_address', None)
nameserver %%getVar('ad_address')
    %end if
    %if %%getVar('activer_ad_smb', 'non') == 'oui' and (%%mode_conteneur_actif == 'non' or %%current_container.name == 'addc')
# Search in Samba AD realm DNS suffix
search %%ad_realm
        %if %%getVar('ad_server_role') == 'controleur de domaine'
# Local Samba AD DNS
nameserver 127.0.0.1
            %if %%getVar('ad_additional_dc') == 'non'
µµµµµµµµµµ We are the sysvol Samba DC reference, we use all additional DC as fallback DNS
                %for %%dns in [dns_ip for dns_ip in %%getVar('ad_additional_dc_ip', [])]
# Samba additionnal DC DNS
nameserver %%dns
                %end for
            %else
µµµµµµµµµµ We are an additional Samba DC, we use sysvol reference as secondary DNS
# Samba sysvol reference DNS
nameserver %%ad_dc_sysvol_ref
                %for %%dns in [dns_ip for dns_ip in %%getVar('ad_additional_dc_ip', []) if dns_ip != %%ad_dc_sysvol_ref]
µµµµµµµµµµ We are an additional Samba DC, we use all othr additional DC as fallback DNS
# Samba additionnal DC DNS
nameserver %%dns
                %end for
            %end if
        %end if
    %else
search %%getVar('nom_domaine_local')
        %if %%is_defined('container_ip_dns')
# DNS in container
nameserver %%container_ip_dns
        %end if
    %end if
%else
# level:minimal

search %%getVar('nom_domaine_local')
%end if
µµµµµµµµµµ We always add the General DNS variable as last fallbacks
%for %%dns in %%getVar('adresse_ip_dns')
# General DNS server
nameserver %%dns
%end for
