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

    How can I put local MX record in pfSense 2.2.5 ?

    DHCP and DNS
    3
    8
    5.9k
    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.
    • M
      MaxManus
      last edited by

      I have installed a local CentOS Postfix mail server .

      As DNS server in pfSense , I have chosen DNS forwarder ( dnsmaq ) .
      I want to add an MX record to the advanced options but I have no idea how to write the MX record in pfSense .
      In 've tried to associate DNS forwarder to a configuration file under
      Advaced = > addn hosts = / etc / extra
      File one:
      mx- host = example.com , mail.example.com , 10

      file to:
      local- data: " example.com . IN MX 10 mail.example.com . "

      TinyDNS I never got to work and seems unstable .

      I am grateful for all the help.

      1 Reply Last reply Reply Quote 0
      • D
        doktornotor Banned
        last edited by

        And what doesn't work for you?

        
        mx-host=example.com,mail.example.com,10
        
        

        You don't need any addn-hosts or whatever.

        1 Reply Last reply Reply Quote 0
        • M
          MaxManus
          last edited by

          Thanks.

          Then status after restart of the DNS Forwarder :

          dnsmasq[44005]: read /etc/extra - 0 addresses
          dnsmasq[44005]: bad address at /etc/extra line 1
          dnsmasq[64861]: read /etc/hosts - 67 addresses

          ?? :-\

          1 Reply Last reply Reply Quote 0
          • D
            doktornotor Banned
            last edited by

            I have no idea what's in /etc/extra. Obviously, whatever you are putting in the advanced field MUST be a local zone. I.e., either the same domain as configured in pfSense, or you need to tell dnsmasq that the domain is local.

            
            local=/example.com/
            mx-host=example.com,mail.example.com,10
            ...
            
            
            1 Reply Last reply Reply Quote 0
            • M
              MaxManus
              last edited by

              It consisted only of the line:```
              mx-host=example.com,mail.example.com,10

              
              now:
              

              local=/example.com/
              mx-host=example.com,mail.example.com,10

              
              The outcome is the same.
              
              I've already registered mail server under Host Overrides , so I guess it's not necessary with the line :
              
              

              mail.example.com A 192.168.1.50

              1 Reply Last reply Reply Quote 0
              • D
                doktornotor Banned
                last edited by

                What outcome is the same? You test DNS with drill, dig, nslookup… (And no, A cannot replace MX record.)

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

                  Dude dok gave you the example syntax to use.. Just put it in the the advanced box for gosh sake..

                  Here.. I disabled resolver since that is what I use, I took exactly what dok gave you.. Started forwarder and queried for MX and there it is….

                  Yes whatever your mx record points to, in this example mail.example.com needs to resolve as well as A record or AAAA...  But that has nothing to do with the MX record..

                  dokmxexample.png
                  dokmxexample.png_thumb

                  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.7.2, 24.11

                  1 Reply Last reply Reply Quote 0
                  • M
                    MaxManus
                    last edited by

                    Thank you :). Sometimes you sweeten what is nearby.

                    I see the log to dnsmasq that they were recorded and through dig.

                    ;; OPT PSEUDOSECTION:
                    ; EDNS: version: 0, flags:; udp: 1280
                    ;; QUESTION SECTION:
                    ;example.com.                    IN      MX
                    
                    ;; ANSWER SECTION:
                    example.com.             1       IN      MX      10 mail.example.com.
                    
                    ;; ADDITIONAL SECTION:
                    mail.example.com.        1       IN      A       192.168.1.50
                    
                    ;; Query time: 2 msec
                    ;; SERVER: 192.168.1.1#53(192.168.1.1)
                    ;; WHEN: Sun Dec 06 19:29:18 CET 2015
                    ;; MSG SIZE  rcvd: 86
                    
                    
                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post
                    Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.