New Zealand | Modifying DHCP Configuration When Running Red Hat Enterprise Linux on Azure 

Sebastian Baszcyj - 14.02.202320230214

Modifying DHCP Configuration When Running Red Hat Enterprise Linux on Azure 

New Zealand | Modifying DHCP Configuration When Running Red Hat Enterprise Linux on Azure 

Are you contemplating the use of Red Hat Enterprise Linux (RHEL) on Microsoft Azure and wondering what considerations you need to take into account? 

While it may appear that operating RHEL on Azure is relatively simple, there are unique enterprise needs that must be addressed when utilizing Azure, distinct from the standard BYOS and PAYG images. Without delving into excessive detail, I will provide some insight on network, particularly DNS configuration, to assist in modifying Azure images to suit your requirements.

Configuring the environment

In the context of this example, it is assumed that there is a VPN connexion established between the Azure VMs and the primary data centre, which could be a different cloud service or an on-premises location. For your hosts and any associated services to function properly, it is necessary to have an internal DNS server in place. By default, when launching a Red Hat Enterprise Linux image on Azure, the /etc/resolv.conf file will likely resemble the one provided below.

$ cat /etc/resolv.conf   # Generated by NetworkManager   search reddog.microsoft.com   nameserver 168.63.129.16O 

While this configuration may be functional and suitable for various situations, it falls short of meeting our needs as it: 

  • Does not query our internal DNS server for resolving internal hostnames.
  • Prohibits us from querying non-FQDN hostnames within our domain.
  • Additionally, it may inadvertently reveal information about our hostnames to the Microsoft DNS server.

Sysadmins who have previous experience with DHCP to assign IP/DNS configurations to their clients will likely be familiar with the necessary techniques. The crucial aspect here is the DHCP client configuration file, dhclient.conf. This file allows for the modification/adaptation of configuration values provided by the DHCP server in this case from Azure. In the interest of creating an easy-to-reproduce and functional example, we will use one of Google’s public DNS servers, 8.8.8.8, as our primary (and only) DNS server and set our domain as redhat.com. To achieve this, we create the configuration file /etc/dhcp/dhclient.conf, containing the following content:

$ cat /etc/dhcp/dhclient.conf   supersede domain-name-servers 8.8.8.8;   supersede domain-search "redhat.com";   supersede domain-name “redhat.com”; 

With the above configuration in place, it is enough to restart the interface or in case NetworkManager is used, you can use the following command: 

# nmcli con up eth0 

With this configuration in place, the generated /etc/resolv.conf will be as follows: 

$ cat /etc/resolv.conf   # Generated by NetworkManager   search redhat.com   nameserver 8.8.8.8 

It is important to note that this example would still lead to leaking of internal hostnames to the Google DNS server. However, for the purpose of ease in reproducing the example, I have chosen a publicly available DNS server for everyone to use. 

There are several other options available to be overridden, added and modified according to your requirements. To learn more about these options, the best practice, as all sysadmins should know, is to consult the man pages. In this case, the following man page is suggested for review: $ man 5 dhclient.conf It is advisable to retain the default values if there is no specific need to change them, but in case you need to add or override any options, you will find them in the manual page.

Get expert help with DHCP configuration when using Red Hat Enterprise Linux on Azure. Contact us now to ensure proper setup and maximise the potential of your RHEL environment on Azure.  

Related Articles

Using a Cockpit in Red Hat Enterprise Linux 8
Insentra’s Red Hat Capabilities
How do I get Started with Microsoft Azure Cost Optimisation?

Join the Insentra Community with the Insentragram Newsletter

Hungry for more?

If you’re waiting for a sign, this is it.

We’re a certified amazing place to work, with an incredible team and fascinating projects – and we’re ready for you to join us! Go through our simple application process. Once you’re done, we will be in touch shortly!

New Zealand | Modifying DHCP Configuration When Running Red Hat Enterprise Linux on Azure 

Unleashing the power of Microsoft Copilot

This comprehensive guide provides everything you need to get your organisation ready for and successfully deploy Copilot.

Who is Insentra?

Imagine a business which exists to help IT Partners & Vendors grow and thrive.

Insentra is a 100% channel business. This means we provide a range of Advisory, Professional and Managed IT services exclusively for and through our Partners.

Our #PartnerObsessed business model achieves powerful results for our Partners and their Clients with our crew’s deep expertise and specialised knowledge.

We love what we do and are driven by a relentless determination to deliver exceptional service excellence.

New Zealand | Modifying DHCP Configuration When Running Red Hat Enterprise Linux on Azure 

Insentra ISO 27001:2013 Certification

SYDNEY, WEDNESDAY 20TH APRIL 2022 – We are proud to announce that Insentra has achieved the  ISO 27001 Certification.