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

add host to pfsense

Scheduled Pinned Locked Moved DHCP and DNS
2 Posts 2 Posters 208 Views 2 Watching
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.
  • W Offline
    WEAREHEREFORIT
    last edited by Apr 2, 2025, 12:50 PM

    Hi,

    I'm have a new job and i'm new to this.
    We use PFsense Community edition

    We have a domain registered at our ISP, lets say www.mywebsite.com.
    We have a server on location we use for an web application with an ipaddres 192.168.8.12.
    So now they have configured it with a subdomain galenclinicas.mywebsite.com, but it's not registered in the Cpanel of the domain.
    We have to add the host on every machine seperatly to be able to acces the application.

    Can i add the host to PFsense somehow?

    Kind regards,
    Ivan

    G 1 Reply Last reply Apr 2, 2025, 1:44 PM Reply Quote 0
    • G Offline
      Gertjan @WEAREHEREFORIT
      last edited by Apr 2, 2025, 1:44 PM

      @WEAREHEREFORIT

      I'll answer in the reverse order :

      @WEAREHEREFORIT said in add host to pfsense:

      Can i add the host to PFsense somehow?

      If, and only f, your pfSense LAN devices are using pfSense as their DNS server (or source), then an easy solution exists :

      Goto the bottom of this page : Services > DNS Resolver > General Settings

      0365dbef-abd8-469f-8ba0-d61637cbbc39-image.png

      (I added 'aa' before the namle so it gets sorted at the top )

      Hit save, Then, at the top of the page : Apply and done.
      Nearly.
      Because now, welcome to your new live : you do things, and then you test them.

      Go to some PC on your network :
      Enter a dos or command box:
      Type :

      nslookup galenclinicas.mywebsite.com
      

      and admire the result.

      Why does this work ?
      Easy.
      Type

      ipconfig /all
      

      and you'll see something like this :

         Serveurs DNS. . .  . . . . . . . . . . : 2a01:dead:beef:a6e2:92ec:77ff:fe29:392c
                                             192.168.8.1
                                             2a01:dead:beef:a6e2:92ec:77ff:fe29:392c
         NetBIOS sur Tcpip. . . . . . . . . . . : Activé
      

      You see the 192.168.8.1 ?
      That your pfSense.
      So, when you use enter a host name like 'www.facebook.com' or 'galenclinicas.mywebsite.com' on your PC (with a browser, probably) the PC will ask the DNS server 192.168.8.1 to do the resolving.
      And that's where the magic kicks in : you told the pfSense Resolver what IPv4 to return when "galenclinicas.mywebsite.com" is used as a host name.

      Btw : this isn't a "pfSense" solution. Your ISP router can - most probably - do the same. Any other router out, with DNS capabilities, there do the same.

      Btw : If your PC uses some other DNS like 8.8.8.8 or 1.1.1.1 or something else as a DNS source (server) then ..... yeah, you have a problem. [ as you can't call them to say "Hey, if "galenclinicas.mywebsite.com" is asked for, can you please return 192.168.8.12 ? ]

      @WEAREHEREFORIT said in add host to pfsense:

      but it's not registered in the Cpanel of the domain

      And why not ?
      ( less important, what is a cpanel ? )

      If you know something about these 192.168.8.x - it's a RFC1918 network/IP, the you know that these IP addresses are not routable over the Internet.
      You have to use your WAN IP as the IPv4.
      If your "mywebsite.com" or "www.mywebsite.com" is already accessible from the Internet, you know what to do. The same pfSense NAT rule will be used.

      Btw : "NAT rules" isn't a pfSense thing neither. Every router box (ISP etc) on planet earth can do NAT since .... a bit before 1980 or so. I bet your are not new to this 👍

      No "help me" PM's please. Use the forum, the community will thank you.
      Edit : and where are the logs ??

      1 Reply Last reply Reply Quote 0
      2 out of 2
      • First post
        2/2
        Last post
      Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
        This community forum collects and processes your personal information.
        consent.not_received