• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

Solve Hostname without local domain

Scheduled Pinned Locked Moved DHCP and DNS
8 Posts 2 Posters 701 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H
    helderingor
    last edited by Jul 29, 2020, 7:16 PM

    So my setup is pretty simple

    • Pfsense old computer with two GbLan ports (wan and Lan)
    • DHCP on Lan , with the subnet 192.168.30.0/24
    • OpenVPN on subnet 192.168.5.0/24 working
    • PfBlockerNG + DNSBL + GeoIP both working on lan and openvn
    • Basic firewall rules to allow port 53,80,443 and email ports

    Everything is working very well, and it's been a life saver , but i wanted to do two things a bit..."better"

    Right now if im on lan (30.0/24) and i ping or smb into srv-example (\srv-example) is works, being a new or old pc, if the DHCP gave him a IP, it works.

    But when i'm connected via openvpn, it doesnt work (yes i have on the unbound dns resolver the ticks to push dhcp static mappings and other mappings) unless i add the "domain" (aka \srv-example.domain)

    Is there a way, either by dns resolver or forwarder that i can achieve on the Openvpn connection to say like a host file 192.168.30.10-> srv-example ? i've tried with the hosts overide but i just cant seem to get it working

    other thing (less important one) : i have a couple of websites that i use h1,h2,h3,h4....h20.example.com and via hosts file on the machine i say they point to 127.0.0.1. is there a way to do this as well via pfsense?

    thanks!

    N 1 Reply Last reply Jul 29, 2020, 7:29 PM Reply Quote 0
    • N
      netblues @helderingor
      last edited by Jul 29, 2020, 7:29 PM

      @helderingor
      see this, especially last post

      https://forum.netgate.com/topic/117495/multiple-domain-search-for-windows-clients

      1 Reply Last reply Reply Quote 1
      • H
        helderingor
        last edited by Jul 29, 2020, 7:33 PM

        you just solved me THE biggest problem i had. simply added the "Provide a default domain name to clients
        " with the same domain as the pfsense and the host, reconnected and BAMM, it works, now i can smb into the machive or rdp, via its hostname !

        now all i need is to figure those pesky 127.0.0.1 entries!

        Thanks!

        N 1 Reply Last reply Jul 29, 2020, 7:43 PM Reply Quote 0
        • N
          netblues @helderingor
          last edited by Jul 29, 2020, 7:43 PM

          @helderingor There is, but its bad practice.
          You could put host overides on unbound, but it will only work for the specific host that the sites are really on.
          There is no point doing this at the network level.
          Have you tried something like that?
          https://chrome.google.com/webstore/detail/livehosts/hdpoplemgeaioijkmoebnnjcilfjnjdi?hl=en

          1 Reply Last reply Reply Quote 0
          • H
            helderingor
            last edited by Jul 29, 2020, 7:56 PM

            @netblues i've since we started talking, managed to in DNS Resolver> Host Overides add , for example h1,h2 and h3.example.com and its now working, problem it that sometimes its like 20 websites, and its a bit of a eye sore to do that. i was looking into wildcards or something like that h**.example.com or even *.example.com. i know you can do that with dnsmasq but not working so far. i'll keep messing with this until i probably give up this perfect utopia of a dream

            1 Reply Last reply Reply Quote 0
            • H
              helderingor
              last edited by helderingor Jul 29, 2020, 8:08 PM Jul 29, 2020, 8:02 PM

              @netblues and it's solved, sometimes im just a bit too damn lazy. easy as in the advanced options, add
              server:
              local-zone: "example.com" redirect
              local-data: "example.com 86400 IN A 127.0.0.1"

              server:
              local-zone: "example.com" redirect
              local-data: "example.com 86400 IN A 127.0.0.1"
              1 Reply Last reply Reply Quote 0
              • N
                netblues
                last edited by Jul 29, 2020, 8:03 PM

                Its in the docs too
                https://docs.netgate.com/pfsense/en/latest/dns/wildcard-records-in-dns-forwarder-resolver.html

                1 Reply Last reply Reply Quote 0
                • H
                  helderingor
                  last edited by Jul 29, 2020, 8:08 PM

                  yup, thats where i saw it.

                  guess next time ill dig a bit deeper before bothering you pros ahah

                  1 Reply Last reply Reply Quote 0
                  8 out of 8
                  • First post
                    8/8
                    Last post
                  Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                    This community forum collects and processes your personal information.
                    consent.not_received