Why no DNS Round Robin with simple DNSMasq on PFSense WebUI?

  • So DNSmasq supports DNS Round Robin, and does it by having multiple entries in /etc/hosts of the same hostname, each with different IP's.

    I'm able to have a cron job go through and constantly check for and re-apply the 2nd entry in /etc/hosts for me, to work around this limitation in the WebUI.  But since it works so well, without needing TinyDNS…  Why is it not possible to create these multiple entries via the WebUI?  It won't let you.  In fact, it will strip out the second IP in /etc/hosts if any DNS updates are handled via the WebUI... (hence the cron job to keep checking and re-adding it)

    I figure there must be some reason, like an old bug that was caused by enabling the feature's use, or something.

    Anyone know why?

  • Rebel Alliance Developer Netgate

    On what version of pfSense?

    I know on 2.1 it does let you make an IPv6 entry in addition to an IPv4 entry, but it still appears to reject multiple IPv4 entries. If it does work, I'm not entirely sure why (other than it would make reverse DNS resolution ambiguous)

  • LAYER 8 Global Moderator

    How about this as simple method, create a file.. I used /tmp/robin and in this file I put

    [2.1-RC0][admin@pfsense.local.lan]/tmp(5): cat /tmp/robin robin.local.lan robin.local.lan robin.local.lan

    now in advanced options of dns forwarder I added (in the gui)

    Now when I do a query for robin.local.lan I get round robin response - see how the answers rotate order

    C:\Windows\System32>dig robin.local.lan +short

    C:\Windows\System32>dig robin.local.lan +short

    C:\Windows\System32>dig robin.local.lan +short

    Now your hosts wont be listed in the gui under dns forwarders host over rides, but would remove your need for a cron job to put them back and errors in the gui, etc.

    "(other than it would make reverse DNS resolution ambiguous)"

    Why do you think that?  If I do a ptr query it still returns the forward for that IP

    C:\Windows\System32>dig -x +short

    C:\Windows\System32>dig -x +short

    C:\Windows\System32>dig -x +short

    I don't know if I would use /tmp as place to store your addn-hosts file, but this was just a test - I currently have no use of round robin entries.

    btw: I am currently running

    2.1-RC0 (i386)
    built on Tue Jul 16 02:16:11 EDT 2013
    FreeBSD 8.3-RELEASE-p8

  • Great idea!


    Hopefully the feature can come to the GUI some day.  :)

  • Yes, that works nicely.

    Thank you!

    I chose to use /etc/roundrobin for my file. :)

Log in to reply