Alias resolution somewhat cripple

  • I have noticed this before and would like to see if something can be done about this.

    When an alias is added to pfSense, it seems that the name gets randomly resolved if there's more than one A record.  An example:

    $ dig
    ; <<>> DiG 9.10.3-P4-Ubuntu <<>>
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 15753
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 0, ADDITIONAL: 1
    ; EDNS: version: 0, flags:; udp: 4096
    ;		IN	A
    ;; ANSWER SECTION:	3464	IN	CNAME	164	IN	A	164	IN	A	164	IN	A	164	IN	A
    ;; Query time: 6 msec
    ;; SERVER:
    ;; WHEN: Tue Sep 12 15:12:00 SAST 2017
    ;; MSG SIZE  rcvd: 144

    So if I add, it doesn't work most of the time in a firewall rule and I have to manually add each ip address to the alias to get the desired result.

    If would be really beneficial if a simple lookup could be done when a name (instead of an ip) is added to an alias and the appropriate records added.  Then one could have a refresh of the name (manually) or at startup or some other event to refresh records that have changed.

    Mikrotik RouterOS has such a capability when one creates firewall address-lists.  You enter the name and the system resolves the records and add one or more to the list as may be required.  This really makes life so much easier.

    Is something like this is the works or could it be added to a list of feature to be expanded?

    thanks and regards


  • LAYER 8 Global Moderator

    not sure what your talking about when create the alias all 7 IPs get listed..  See attached, there are IPv6 as well.

    aliases are refreshed every 5 minutes.. unless you change it.

    Maybe whatever your trying to do is not working because of the IPv6 addresses and your not allowing or blocking that in your rules and the client is using the IPv6

  • Rebel Alliance Developer Netgate

    If the DNS records for a host are returned randomly, any method you use will be an ugly hack. You can't rely on anything like aliases to resolve and get the same answer as clients.

    Your best bet might be to set the alias refresh timer to lower than the TTL of a record and hope your cached result in unbound matches what is in the alias.

  • Thanks for your responses!

    I rechecked the aliases vs the results of a dig / drill of the name and it does indeed add all the addresses correctly.  I had quite some problems with this in the past, but I never really figured out how I could check the resolution.  I didn't know about diagnostics | tables.

  • LAYER 8 Global Moderator

    "and it does indeed add all the addresses correctly."

    So then what is the exact problem your having?