OPNsense Forum

English Forums => General Discussion => Topic started by: checkulater on January 14, 2018, 02:46:45 pm

Title: [Solved]: Redirection to router not wanted.
Post by: checkulater on January 14, 2018, 02:46:45 pm
Hello im pretty noob when it comes to routers and am in the process of learning. Right now when I'm typing in any adess (domain name not ip adress) that does not exist, either when im pinging it or typing it in to my webrowser, it redirects to my router adress.
I do not want this. I rather it just fails. Is there a way I do this?

Thanks in advance.

SOLVED:
ok  I have solved my problem. When using dyndns i used wildcards and that in turn somehow looped out because of of the problem with NetworkManager rewriting my resolv.conf to add the line "search mydomainname.com" that in turn made it so it first tested the domainname i wrote and when it could not be found it added .mydomainname.com to it an because i used wildcards with my dns provider it would be found and rerouted to my opnsense router.

Hope this helps anyone from banging their heads against the wall to much.
Title: Re: Redirection to router not wanted.
Post by: phoenix on January 14, 2018, 03:02:42 pm
Do you have a DNS server enabled on your LAN or on the OPNsense firewall?
Title: Re: Redirection to router not wanted.
Post by: checkulater on January 14, 2018, 03:04:27 pm
I use unbound dns resolver on opnsense
Title: Re: Redirection to router not wanted.
Post by: phoenix on January 14, 2018, 03:17:44 pm
You don't say what operating system you're using on the lan but does that have the unbound server as it's DNS resolver? Can you ping an external site from a machine on your LAN? This problem sounds like there is no DNS server set on the LAN machine.
Title: Re: Redirection to router not wanted.
Post by: checkulater on January 14, 2018, 03:29:23 pm
ahh ok
i use linux on this machine but i have tried from a windows machine also a telephone same result.
I use dhcp so all machines get my opnsense firewall as dns. the dhcp server is also the opnsense firewall.

Evereything works well and i can reach the internet well. But when I type an adress that does not exist on the wan or the lan it automatically redirects me to my opnsense firewall. I dont like this behaviour.

I have set the following in unbound:
Register DHCP leases in the DNS Resolver
Register DHCP static mappings in the DNS Resolver

and the following in System: General:
Allow DNS server list to be overridden by DHCP/PPP on WAN
Title: Re: Redirection to router not wanted.
Post by: checkulater on January 14, 2018, 03:56:11 pm
can it be that my resolv.conf in linux has the following

search [mydomainname.com]
Title: Re: Redirection to router not wanted.
Post by: checkulater on January 14, 2018, 04:03:02 pm
seems its with my linux computer i did not test it right before.
Title: Re: Redirection to router not wanted.
Post by: phoenix on January 14, 2018, 04:15:38 pm
seems its with my linux computer i did not test it right before.
Yes, you need that as well.
Title: Re: Redirection to router not wanted.
Post by: checkulater on January 14, 2018, 04:17:18 pm
does anyone here use linux with networkmanager and know how to not write a search command to resolv.conf? that seemed to cause the problem
Title: Re: Redirection to router not wanted.
Post by: checkulater on January 14, 2018, 06:52:46 pm
or is there a way to not send domain search to the clients thru opnsense dhcp server?
Title: Re: Redirection to router not wanted. [solved]
Post by: checkulater on January 14, 2018, 07:49:34 pm
ok  I have solved my problem. When using dyndns i used wildcards and that in turn somehow looped out because of of the problem with NetworkManager rewriting my resolv.conf to add the line "search mydomainname.com" that in turn made it so it first tested the domainname i wrote and when it could not be found it added .mydomainname.com to it an because i used wildcards with my dns provider it would be found and rerouted to my opnsense router.

Hope this helps anyone from banging their heads against the wall to much.