Mitel Forums - The Unofficial Source

Mitel Forums => Mitel Software Applications => Topic started by: Ronan on June 16, 2025, 03:53:22 AM

Title: Micollab hosts file getting regenerated regularly
Post by: Ronan on June 16, 2025, 03:53:22 AM
Hello all.

There is a service/script somewhere that is regenerating the hosts file on Micollab. I thought it would only do this on reboot but this isn't so, it's done after some hours or days.

We are looking into adding a DNS server but it's complicated, however the Micollab are using corporate DNS (that we don't control) and since there are a lot of customizations with service pro apps etc. I'm weary of changing that, I fear I will forget something and break something which I can't afford right now.

So to make peering between 2 micollabs work, I edited the hosts files on each so that they can reach the other using FQDN.

That works, that is until the hosts files get rewritten.

Someone told me that there is a script, maybe run by a service, that does this, and if I edit the config file of that I could get my manual entries to be still there in the regenerated hosts file. I can't find what it is, any hints ?

Thanks
Title: Re: Micollab hosts file getting regenerated regularly
Post by: dilkie on June 16, 2025, 08:37:24 AM
yes, it is scripted.. however you can add to the scripting easy enough... you need to add a custom template to /etc/e-smith/templates-custom/etc/hosts

you'll have to create that path if it doesn't exist. the add a template file with your info...

you can see the existing templates used to construct the /etc/hotsts file in /etc/e-smith/templates/etc/hosts, use those for examples and note that they are processing in alphabetical order, hence the leading digits.

after adding your custom template, run

expand-template /etc/hosts

to update.
Title: Re: Micollab hosts file getting regenerated regularly
Post by: sarond on June 16, 2025, 09:21:44 AM
Saving certain pages in server manager will regenerate files as well.

Maybe not the approach you were thinking, but this is what we do to create a static DNS entry on an MSL server.

- First take note of the corporate DNS before making changes.
- Configuration > Domains remove current corporate DNS servers (This allows you to configure Hostnames and addresses).
- Configuration > Hostnames and addresses > add an entry for the hostname you want and set as remote.
- Go back to domains and add the corporate DNS back in.

There is also a way to add via SSH console using db command but that's not advised as it could break something.
Title: Re: Micollab hosts file getting regenerated regularly
Post by: dilkie on June 16, 2025, 09:23:21 AM
even better!!

Saving certain pages in server manager will regenerate files as well.

Maybe not the approach you were thinking, but this is what we do to create a static DNS entry on an MSL server.

- First take note of the corporate DNS before making changes.
- Configuration > Domains remove current corporate DNS servers (This allows you to configure Hostnames and addresses).
- Configuration > Hostnames and addresses > add an entry for the hostname you want and set as remote.
- Go back to domains and add the corporate DNS back in.

There is also a way to add via SSH console using db command but that's not advised as it could break something.
Title: Re: Micollab hosts file getting regenerated regularly
Post by: sarond on June 16, 2025, 09:30:05 AM
It's easier if someone isn't comfortable with the console.

Although I just tested by adding a file into the templates and I like that way as well.
Title: Re: Micollab hosts file getting regenerated regularly
Post by: johnp on June 16, 2025, 04:05:31 PM
Do like the custom-template thing as if needing to go back you just delete and expand
Title: Re: Micollab hosts file getting regenerated regularly
Post by: sarond on June 16, 2025, 11:31:03 PM
Do like the custom-template thing as if needing to go back you just delete and expand

I like it as well, but it is harder to track whats going on for other techs that aren't aware of this method as it doesn't appear in the web ui.
Title: Re: Micollab hosts file getting regenerated regularly
Post by: Ronan on June 19, 2025, 05:50:34 AM
Thanks for the answers.

I edited the template and it works. However I didn't know I could combine corporate DNS and the hostnames and addresses by just deactivating corporate DNS, making the change, and reactivating. That seems like a better option, notably if we need to restore a backup. I will test this.