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

    Host name help

    Scheduled Pinned Locked Moved General pfSense Questions
    18 Posts 4 Posters 1.3k 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.
    • johnpozJ
      johnpoz LAYER 8 Global Moderator
      last edited by

      Assign the machine a static via the dhcp server, ie a reservation..

      For example I have a windows 10 machine name i5-win, yes very creative since it a I5 cpu running windows ;)

      dhcpreservations.png

      So via dhcp it will always get that 192.168.9.100 IP, since my domain in pfsense is set to local.lan - the fqdn for this host will be i5-win.local.lan

      Since I have unbound set to register dhcp reservations in dns, I will be able to resolve that via the fqdn.. Since windows will auto add the domain to a query.. I can do just query for the host name and get back the fqdn

      > i5-win
      Server:  sg4860.local.lan
      Address:  192.168.9.253
      
      Name:    i5-win.local.lan
      Address:  192.168.9.100
      

      ping of just host, any box that uses a search suffix for the domain your using will return the fqdn and IP

      root@uc:/tmp# ping i5-win
      PING i5-win.local.lan (192.168.9.100) 56(84) bytes of data.
      64 bytes from i5-win.local.lan (192.168.9.100): icmp_seq=1 ttl=127 time=0.748 ms
      64 bytes from i5-win.local.lan (192.168.9.100): icmp_seq=2 ttl=127 time=0.728 ms
      64 bytes from i5-win.local.lan (192.168.9.100): icmp_seq=3 ttl=127 time=0.632 ms
      

      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 1
      • H
        Hammer8
        last edited by

        Thank you! That did the trick. Appreciate everyone’s help. Out of curiosity, why is it under pfsense, I need to specify a MAC address and with my Netgear router, I didn’t have to? Not a big deal, but will need to change the entry in Pfsense if my hardware changes.

        1 Reply Last reply Reply Quote 0
        • JKnottJ
          JKnott @Hammer8
          last edited by

          @Hammer8 said in Host name help:

          Hmm...thank you all, but I’m not sure what I need to do.

          If the computer is connected to the network, it should have an address. You can go into the Status > DHCP Leases to find that address. You can then click on the "+", 2nd from right, to add a static mapping. You then set the address you want and give it a host name. When you have done this, the device will have a static address and a host name that you can use.

          PfSense running on Qotom mini PC
          i5 CPU, 4 GB memory, 32 GB SSD & 4 Intel Gb Ethernet ports.
          UniFi AC-Lite access point

          I haven't lost my mind. It's around here...somewhere...

          1 Reply Last reply Reply Quote 0
          • stephenw10S
            stephenw10 Netgate Administrator
            last edited by stephenw10

            It's not actually using the MAC address there. Entering it as a static lease is a convenient way of getting the hostname/IP address into the DNS resolver. You could also add those as host overrides in the DNS resolver directly and it would have the same effect.
            Adding it as a static lease means you don't accidentally assign the IP to another device as it's already in table. It also means if that device changes from static to DHCP for some reason it will pull the same IP address.

            Steve

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

              I your client would of been dhcp already, you wouldn't of had to call out the mac - since pfsense would of already known it and you could just clicked the little add button.. in the lease table and put in the IP you wanted the client to use (outside of the dhcp scope)

              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
              • H
                Hammer8 @stephenw10
                last edited by

                @stephenw10 said in Host name help:

                It's not actually using the MAC address there. Entering it as a static lease is a convenient way of getting the hostname/IP address into the DNS resolver. You could also add those as host overrides in the DNS resolver directly and it would have the same effect.
                Adding it as a static lease means you don't accidentally assign the IP to another device as it's already in table. It also means if that device changes from static to DHCP for some reason it will pull the same IP address.

                Steve

                Hi, I deleted the entries I entered previously under DHCP Static Mappings and re-entered them as host overrides under DNS resolver and it doesn't seem to work. Eg., I can't access the shares as \Piano in Windows explorer. These machines are all part of a WORKGROUP and not part of a DOMAIN so under domain, I entered "local". Is there anything else I need to do? Thank you!

                1 Reply Last reply Reply Quote 0
                • stephenw10S
                  stephenw10 Netgate Administrator
                  last edited by

                  It has to match whatever they were showing up as in the dhcp leases. I expect that to be whatever the pfSense domain is unless you set something specifically in the dhcp server.
                  Is there some reason you don't want to use dhcp static lease entries for this?

                  Steve

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

                    Your machine will use a domain to resolve dns.. workgroups have nothing to do with it..

                    In your pfsense what does it say for the domain, see my post above.

                    On your client what does it say.. do an ipconfig /all

                    $ ipconfig /all
                    
                    Windows IP Configuration
                    
                       Host Name . . . . . . . . . . . . : i5-win
                       Primary Dns Suffix  . . . . . . . : local.lan
                       Node Type . . . . . . . . . . . . : Broadcast
                       IP Routing Enabled. . . . . . . . : No
                       WINS Proxy Enabled. . . . . . . . : No
                       DNS Suffix Search List. . . . . . : local.lan
                    

                    See the local.lan as the primary domain suffix, and the search list..

                    If you setup a host override for piano.local - then that is what you would have to do a specific dns query for.

                    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
                    • H
                      Hammer8 @stephenw10
                      last edited by

                      @stephenw10 said in Host name help:

                      It has to match whatever they were showing up as in the dhcp leases. I expect that to be whatever the pfSense domain is unless you set something specifically in the dhcp server.
                      Is there some reason you don't want to use dhcp static lease entries for this?

                      Steve

                      Yes, I remote access into these machines and so need a static IP. When you say it has to match the dhcp leases, how can I find what that is? When I go to view the dhcp leases, these machines don't show up...I thought is was because they are set up as static IP's. Note I set these up with static ip's within Windows.

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

                        What does remote access have to do with anything?? When you set a dhcp reservation - that machine will always get that IP.

                        You can set them up on your machine directly if you want - lot of extra work for nothing.. But your host override will work as well as long as your fqdn (fully qualified domain name) is correct and that is what you query for.

                        Here..

                        override.png

                        $ ping piano.local
                        
                        Pinging piano.local [192.168.9.10] with 32 bytes of data:
                        Reply from 192.168.9.10: bytes=32 time<1ms TTL=64
                        Reply from 192.168.9.10: bytes=32 time<1ms TTL=64
                        Reply from 192.168.9.10: bytes=32 time<1ms TTL=64
                        

                        piano.png

                        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

                        JKnottJ 1 Reply Last reply Reply Quote 0
                        • JKnottJ
                          JKnott @johnpoz
                          last edited by

                          @johnpoz said in Host name help:

                          But your host override will work as well as long as your fqdn (fully qualified domain name) is correct and that is what you query for.

                          As I mentioned above, it's very easy to just get a DHCP address, find it in the DHCP leases and change it to a static mapping and provide a host name, all on the same page. Otherwise, you have to determine the MAC address and then configure the mapping.

                          PfSense running on Qotom mini PC
                          i5 CPU, 4 GB memory, 32 GB SSD & 4 Intel Gb Ethernet ports.
                          UniFi AC-Lite access point

                          I haven't lost my mind. It's around here...somewhere...

                          H 1 Reply Last reply Reply Quote 0
                          • H
                            Hammer8 @JKnott
                            last edited by

                            Thanks. I get it now. Don't specify the static ip on the pc. Set it to use DHCP and then in pfsense, make it a static ip on the DHCP leases page. Works great! Thank you.

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