Static DHCP mapping with hostname instead of I.P.



  • Hello,

    Is it possible to use a hostname instead of an I.P. for setting up a DHCP static mapping?

    dhcpd.conf allows for the fixed-address option to assign an I.P. address or a name.
    I cannot seem to get this to work with pfSense 2.2.2 using the Web GUI.

    e.g.  Can the Web Gui add a fixed-address entry for a name like so?
    host aHost1 {
                    hardware ethernet a1:b1:c1:d1:e1:f1;
                    fixed-address aHost1;
            }

    instead of

    host aHost1 {
                    hardware ethernet a1:b1:c1:d1:e1:f1;
                    fixed-address 192.168.1.1;
            }

    Leaving the I.P. address empty omits the fixed-address option from the dhcpd.conf when using the
    Web GUI.

    Only entering a hostname does not appear to allow a static assignment of an I.P.
    Hostnames have been defined in the /etc/hosts and also in the DNS resolver.


  • Banned

    Huh? WTF. You do not set hostname via fixed-address. You can use option host-name but that's gonna have no effect if the hostname is already set on the machine. I.e, only usable for something like PXE boot or whatever.



  • Thank you for your input.

    The fixed-address option can be an I.P or a name.
    The Web GUI does validation for an I.P. address so no name can ever be entered.

    Looks like modification of the Web PHP will be needed to disable the I.P. check,
    or to find other ways of loading dhcpd.conf that is created outside of the GUI.


  • Banned

    @terse_one:

    The fixed-address option can be an I.P or a name.

    No.

    Completely twisted logic here.

    • Go to Services - DNS Resolver
    • Tick this box:

    • Configure your static leases in DHCP server.
    • Done.

    Absolutely no need to mess with /etc/hosts. Not to mention there's Host Overrides in DNS Resolver if you want to add custom DNS records.
    Absolutely no need to mess with dhcpd.conf.
    Absolutely no need to disable any checks.


Log in to reply