OPNsense Forum

English Forums => Web Proxy Filtering and Caching => Topic started by: cristian_asir on May 06, 2019, 08:39:33 AM

Title: /etc/hosts issue
Post by: cristian_asir on May 06, 2019, 08:39:33 AM
Hello, I have an issue with /etc/hosts.

I make changes in /etc/hosts but when I reboot OPNsense this changes dissapear and I have the same content than before.


Is so strange but I need to resolve it because I want to join an AD domain
Title: Re: /etc/hosts issue
Post by: franco on May 06, 2019, 08:50:07 AM
What are you trying to add? Normally you use Unbound or Dnsmasq host overrides to fill that file.


Cheers,
Franco
Title: Re: /etc/hosts issue
Post by: cristian_asir on May 06, 2019, 08:55:06 AM
That

127.0.0.1 localhost.localdomain localhost
10.109.2.80 OPNsense.localdomain OPNsense
search proxy.asir
domain proxy.asir

Title: Re: /etc/hosts issue
Post by: franco on May 06, 2019, 08:56:52 AM
Do you need this info for clients only or the firewall as well? BTW, "search" and "domain" belong to resolv.conf (which is also rewritten for safety).


Cheers,
Franco
Title: Re: /etc/hosts issue
Post by: cristian_asir on May 06, 2019, 09:03:10 AM
Sorry sorry...

I try to write

127.0.0.1 localhost.localdomain localhost
10.109.2.80 OPNsense.localdomain OPNsense

(/etc/hosts)

But when I reboot OPNsense the second line (10.109.2.80 OPNsense.localdomain localdomain) changes and I have other line content
Title: Re: /etc/hosts issue
Post by: franco on May 06, 2019, 09:04:35 AM
Yup, you can use Dnsmasq and Unbound host overrides to achieve this.


Cheers,
Franco
Title: Re: /etc/hosts issue
Post by: cristian_asir on May 06, 2019, 09:14:43 AM
I will try it, thanks for your help!!
Title: Re: /etc/hosts issue
Post by: franco on May 06, 2019, 09:26:04 AM
Sure, let us know if it works. It might not end up in /etc/hosts specifically, but it will be served by Unbound/Dnsmasq itself.


Cheers,
Franco
Title: Re: /etc/hosts issue
Post by: cristian_asir on May 06, 2019, 09:28:39 AM
root@OPNsense:~ # cat /etc/hosts
127.0.0.1       localhost localhost.localdomain
192.168.60.1    OPNsense.localdomain OPNsense >> This is the issue: I have the ip of one of my clients interfaces. AND I WANT the IP of my firewall :((
root@OPNsense:~ # cat /etc/resolv.conf
domain localdomain
nameserver 10.109.2.80
root@OPNsense:~ #