Change the domain name of the MoodleBox


The operations described on this page may render your MoodleBox unusable, requiring the complete wiping of the SD card and the loss of all data (course contents, installed plug-ins, custom configurations, etc.). Do this only if you know exactly what you are doing. In any case, no support is provided on this subject.

We accept no responsibility for any direct or indirect damage caused by the use of the MoodleBox, in particular following a change of domain name.

How to proceed

The example below shows how to change the domain name of a MoodleBox, which will allow a local device to reach it with a new URL. The example shows how to give the MoodleBox the domain name


This operation has no influence on access to the MoodleBox from an Ethernet network or from the Internet: the MoodleBox will remain accessible only from the Wi-Fi network it provides, from the devices that have connected to it.

Step 1: Change the host name (hostname)

In the last line of the /etc/hosts file, replace moodlebox with mybox.

In the /etc/hostname file, replace moodlebox with mybox (this modification is not necessary, but highly recommended).

Step 2: Adapt the configuration of the nginx web server

Change the file /etc/nginx/sites-available/default, replacing moodlebox with the full domain name (FQDN) in the server_name directive.

Step 3: Adapt the DHCP server configuration

Change the file /etc/dnsmasq.conf, replacing home by in the two lines that start with domain and local.

Step 4: Adapt the Moodle configuration (Moodle URL)

In the file /var/www/moodle/config.php, on the line beginning with $CFG->wwwroot, replace the URL http://moodlebox.home by Do not add a slash at the end of the URL.

Step 5: Restart the MoodleBox

In order to apply these changes, restart your MoodleBox.

Step 6: Replace Moodle URLs

Access your MoodleBox through your browser using the new address and use the URL replacement tool at to replace URLs in the Moodle database.

Other options available