0

I have got in a situation where hosts mentioned in the haproxy are resolved into it's ip and sends the request. But in host's server, where they have configured to receive request only with the host as name say "ug1.firstlink.com:367/yts/display" instead as by it's ip "10.78.15.123:367/yts/display".

Tried to use resolvers, but iam not able to start haproxy and i am getting errors, so would like to know if any one who has already used it once.

My configuration:

resolvers mydns
    nameserver dns1 ug1.firstlink.com:367

and in listener

server-template server1 1 ug1.firstlink.com:367 check resolvers mydns init-addr none

Please let me know how to configure properly that haproxy should disable dns resolution and thanks for the response.

susil95
  • 123
  • 1
  • 5
  • Please clarify, is ug1.firstlink.com the backend were you are forwarding the requests to, or its the FQDN of your private dns? – BANJOSA Mar 05 '20 at 09:28
  • Hi it is the backend where i pass the request and also the Domain name for a private ip. – susil95 Mar 05 '20 at 12:10
  • but you are defining it as your dns server in the configuration above. In another note, all FQDN are resolved to IP's, that how the DNS works and that how you communicate with other servers on the internet. – BANJOSA Mar 05 '20 at 12:13
  • Sorry for the wrong input, ug1.firstlink.com is a backend link or host where i forward the requests, and i added resolvers with limited knowledge about it, but i am still learning that, and iam still not sure if resolvers will help. – susil95 Mar 05 '20 at 12:18

1 Answers1

0

Generally speaking you would want the DNS name of your service ("service.example.com") to resolve to the HAProxy server's listener address. Then you would call your backend servers something else ("webserver1.example.com"), even though you may still configure them to listen specifically for requests to "service.example.com". They will know the client requested the correct name through the contents of the Host header field in the request, even though the actual machines have a different name.

If you want a resolvers definition in HAProxy, it should only contain the address of one or more DNS servers you want to query; not the backend servers whose names you want to look up.

Mikael H
  • 5,031
  • 2
  • 9
  • 18