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

    Override pfSense hostname DNS entry

    Scheduled Pinned Locked Moved DHCP and DNS
    9 Posts 4 Posters 1.8k 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.
    • T
      tantkomo
      last edited by

      This is a minute issue on which I didn't manage to find any information anywhere, from what I see pfSense's hostname automatically points itself to one of the physical local interfaces, without digging through system configuration files.
      I was wondering if there is any way to override this entry and make it resolve to a custom address; for example pfsense.localnet > 192.168.20.1 (VLAN20) instead of it being pointed to the physical interface eg. pfsense.lan > 192.168.1.1?

      G 1 Reply Last reply Reply Quote 0
      • GrimsonG
        Grimson Banned
        last edited by

        https://www.netgate.com/docs/pfsense/book/services/dns-resolver.html

        1 Reply Last reply Reply Quote 0
        • T
          tantkomo
          last edited by

          That's the first thing I tried, but it just pushes the IP I set below the one it sets itself.

          1 Reply Last reply Reply Quote 0
          • G
            gjaltemba @tantkomo
            last edited by

            @tantkomo Connect your pfSense lan interface to vlan20. Assign static ip 192.168.20.1 to lan interface. Assign pfsense as hostname and localnet as domain.

            T 1 Reply Last reply Reply Quote 0
            • T
              tantkomo @gjaltemba
              last edited by

              @gjaltemba You mean I should assign the LAN interface to be the parent of the VLAN20 interface or bridge them together?

              G 1 Reply Last reply Reply Quote 0
              • johnpozJ
                johnpoz LAYER 8 Global Moderator
                last edited by johnpoz

                The name set in pfsense will point to the lan IP.. If you create vlans then just create host overrides that point to those.

                So for example.. here are couple of vlans I have setup and how the IPs of pfsense resolve them

                C:\>dig sg4860.wlan.local.lan +short
                192.168.2.253
                
                C:\>dig -x 192.168.3.253 +short
                sg4860.dmz.local.lan.
                

                The name setup in system for my local pfsense is sg4860.local.lan which yeah very imaginative name ;)

                C:\>dig sg4860.local.lan +short
                192.168.9.253
                

                So for any hosts you put in your different vlans create host overrides for them say host.vlan.domain.tld which can be anything you want them to be..

                The use of unbound to resolve your local stuff for a few domains or subdomains is fine if handful of devices, etc... But once your network grows you prob going to want a true authoritative ns for you local domains.. Which is not what unbound really meant to do.. Bind would be better choice for authoritative name services.

                An intelligent man is sometimes forced to be drunk to spend time with his fools
                If you get confused: Listen to the Music Play
                Please don't Chat/PM me for help, unless mod related
                SG-4860 24.11 | Lab VMs 2.8, 24.11

                1 Reply Last reply Reply Quote 0
                • G
                  gjaltemba @tantkomo
                  last edited by

                  @tantkomo It depends on what you are trying to achieve.

                  Will pfsense.localnet have one or two ip (192.168.1.1 or/and 192.168.20.1)?

                  T 1 Reply Last reply Reply Quote 0
                  • T
                    tantkomo @gjaltemba
                    last edited by

                    @gjaltemba It only has the VLAN interface assigned, the parent interface is unassigned, which is my problem, the default hostname points to it

                    1 Reply Last reply Reply Quote 0
                    • johnpozJ
                      johnpoz LAYER 8 Global Moderator
                      last edited by johnpoz

                      Points to what if its not assigned?

                      LAN would be assigned to your vlan then and that is what it would respond with for IP..

                      0_1543057333155_lanonvlan.png

                      ;; OPT PSEUDOSECTION:
                      ; EDNS: version: 0, flags:; udp: 4096
                      ;; QUESTION SECTION:
                      ;pfsense.localdomain.           IN      A
                      
                      ;; ANSWER SECTION:
                      pfsense.localdomain.    3600    IN      A       192.168.3.45
                      

                      Yes the system name is going to point to the ip assigned to the LAN interface...

                      If your not wanting to use the untagged network of the physical interface of LAN and want vlan 20 to be your lan - then setup the lan interface to use vlan 20 as like my above pic and set the name of pfsense to whatever it is you want. Now that name will return the IP of vlan 20. In other words LAN...

                      An intelligent man is sometimes forced to be drunk to spend time with his fools
                      If you get confused: Listen to the Music Play
                      Please don't Chat/PM me for help, unless mod related
                      SG-4860 24.11 | Lab VMs 2.8, 24.11

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post
                      Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.