Em haproxy > = 1.7, você deve poder usar a opção init-addr
, especificando nenhuma para impedir a resolução de DNS na inicialização.
Dos docs :
init-addr {last | libc | none | <ip>},[...]*
Indicate in what order the server's address should be resolved upon startup if it uses an FQDN. Attempts are made to resolve the address by applying in turn each of the methods mentionned in the comma-delimited list. The first method which succeeds is used. If the end of the list is reached without finding a working method, an error is thrown. Method "last" suggests to pick the address which appears in the state file (see "server-state-file"). Method "libc" uses the libc's internal resolver (gethostbyname() or getaddrinfo() depending on the operating system and build options). Method "none" specifically indicates that the server should start without any valid IP address in a down state. It can be useful to ignore some DNS issues upon startup, waiting for the situation to get fixed later. Finally, an IP address (IPv4 or IPv6) may be provided.
Então, sua linha de configuração pode ser:
server s1 myhostname init-addr none