Network
DNS
This page applies to:
- HAProxy ALOHA - all versions
You can configure which DNS servers to query when HAProxy ALOHA needs to resolve a server’s hostname. This is necessary, for example, when you want to specify a hostname instead of an IP address when defining a backend server. Also, features like Single Sign-on depend on resolving hostnames. Typically, these DNS servers will reside within the local network.
Changes affect the system’s /etc/resolv.conf
file.
Caution
HAProxy ALOHA doesn’t perform DNS resolution for its internal system. For services such as NTP, syslog, and others that require the use of external servers, you should configure these services to use the servers’ IP addresses instead of their names or FQDNs. If you need to reference external servers by name, statically declare server names and IP addresses in /etc/hosts.
Configure DNS servers Jump to heading
-
In the Services tab, click system setup next to the system service.
-
Use the
dns_servers
directive to specify the IP addresses of your DNS servers, where each IP address is separated by a space.haproxyservice systemdns_servers 192.158.0.10 192.168.0.11haproxyservice systemdns_servers 192.158.0.10 192.168.0.11 -
Optional: Use the
dns_domain
directive to specify the search list, which is equivalent to setting asearch
directive in/etc/resolv.conf
. This allows you to use a server’s hostname in your configuration instead of its fully qualified domain name.If you specify the DNS suffix
example.com
, you will only have to typeapp
in your configuration, which will expand toapp.example.com
.haproxyservice systemdns_servers 192.158.0.10 192.168.0.11dns_domain example.comhaproxyservice systemdns_servers 192.158.0.10 192.168.0.11dns_domain example.com -
Optional: Use the
hostname
directive to change the HAProxy ALOHA hostname.haproxyservice systemdns_servers 192.158.0.10 192.168.0.11dns_domain example.comhostname aloha1haproxyservice systemdns_servers 192.158.0.10 192.168.0.11dns_domain example.comhostname aloha1 -
Reload the system service.
-
To make your changes persistent after a reboot, click the Setup tab. Then click Save under Configuration.
Troubleshooting Jump to heading
Below, you will find potential solutions to issues that may arise when configuring DNS with HAProxy ALOHA.
Improve boot time Jump to heading
If you are experiencing long boot times, this may be due to failing DNS lookups for external servers for NTP, syslog, and others. HAProxy ALOHA doesn’t perform DNS resolution for its internal system. We recommend using these external servers’ IP addresses instead of their names or FQDNs to improve your boot times. If you need to reference these types of external servers by name, we recommend you set static server names and IP addresses in /etc/hosts.
Set static server names and IP addresses in the hosts file Jump to heading
If you need to reference external servers by name instead of by IP address in your configuration, such as in the configuration for the NTP or syslog services, we recommend statically declaring the names and IP addresses of these servers in HAProxy ALOHA’s /etc/hosts
file.
Exercise caution when using DNS with /etc/hosts entries
If you or other authorized HAProxy ALOHA users add entries to the /etc/hosts
file, keep in mind that having DNS entries for the same servers may also cause collisions for lookups. If you are experiencing unexpected behavior when trying to reference a server by name in your configuration, ensure that you haven’t defined the server in both places or possibly with different IP addresses for the same server name.
To add an entry to the /etc/hosts
file on the HAProxy ALOHA server:
-
Edit the file
/etc/hosts
. To edit this file using the UI, select the Tools tab, then use the File Manager to navigate to the/etc
folder and edit the filehosts
. -
Add your server entries. Many entries may be present in the file, depending on your system. Add new entries at the end of the file. For example, to reference an NTP server named
ntp.test.local
with its IP address instead, add its IP address and server name to/etc/hosts
:/etc/hoststext127.0.0.1 localhost# [...] additional entries may be present here192.168.99.125 ntp.test.local/etc/hoststext127.0.0.1 localhost# [...] additional entries may be present here192.168.99.125 ntp.test.local -
Click Save.
-
To make the changes persist after a reboot, go to the Setup tab and click Save within the Configuration section.
Do you have any suggestions on how we can improve the content of this page?