Edit /etc/host and keep changes permanently

  • Can I edit /etc/hosts file and make changes permanently?


    I open file with nano and this is first two lines


    Code
    # This file is auto-generated by openmediavault (https://www.openmediavault.org)
    # WARNING: Do not edit this file, your changes will get lost.

    = Fujitsu PRIMERGY TX1310 M3 • 2 x HDD 3.5" 4TB Western Digital Red • Windows Server 2019 • Hyper-V • OMV 5.x =

  • gett

    Changed the title of the thread from “Edit /etc/host” to “Edit /etc/host and keep changes permanently”.
  • Look here


    Thank you for answer, but that not help me. I have a valid DNS address configured, OMV works fine. I just want to to map domain names to IP addresses in /etc/hosts. For example:


    192.168.10.10:8765 heimdall.mydomain.com

    = Fujitsu PRIMERGY TX1310 M3 • 2 x HDD 3.5" 4TB Western Digital Red • Windows Server 2019 • Hyper-V • OMV 5.x =

  • Are you using dnsmasq? If so just create another hosts file. Save it where ever you want.


    Go to this portion of your dnsmasq.conf and add the “addn” line.


    Code
    # or if you want it to read another file, as well as /etc/hosts use this.
    addn-hosts=/srv/dev-disk-by-label-HomeDrive/"config files”/dnsmasq/hosts2

    Obviously change the path to where you keep yours and the file name. I called mine hosts2.


    Here is how my hosts2 file looks


    Hopefully the formatting comes out correctly. Now mydomain resolves to my Pi.

  • is not a valid hostname

    Thanks, I type in hurry.



    I use PiHole docker container

    Unfortunately, my provider's modem don't allow me to change DNS in settings, so I'm stuck with DNS from my provider. As far as I understand, I have to change DNS in modem for using Pi hole

    = Fujitsu PRIMERGY TX1310 M3 • 2 x HDD 3.5" 4TB Western Digital Red • Windows Server 2019 • Hyper-V • OMV 5.x =

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!