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

    [SOLVED] /etc/hosts broken

    Scheduled Pinned Locked Moved DHCP and DNS
    2 Posts 1 Posters 2.7k Views
    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
      Mazzolino
      last edited by

      We have been running pfSense 2.0-RELEASE without problems for a long time, using DHCP static leases as well as DNS forwarder overrides.

      That said, DNS problems have been appearing as of late. Some host names are not being resolved any more.

      I logged into pfSense by SSH and looked at /etc/hosts. The file is broken. The first paragraph (static dhcp and dns forwarder hosts) is truncated and ends like this:
      (hostnames replaced with xx's)

      
      ...
      192.168.1.202   xxx.xxxx.xx xxx                                                                                                                                                      
      4
      
      ``` 
      
      Immediately after that, there is the the following section, two times (!):
      
      

      dhpleases automatically entered

      192.168.1.99   xxx.xxxx.xx xxx            # dynamic entry from dhcpd.leases          
      192.168.1.92   xxx.xxxx.xx xxx                # dynamic entry from dhcpd.leases    
      ...

      
      I had to manually remove hosts from the static dhcp and dns forwarder lists, so that some static hosts reappear in the first paragraph. The list is still garbled though:
      
      

      ...
      192.168.1.202   xxx.xxxx.xx xxx                                                                                                                                                      
      4192.168.1.94   xxx.xxxx.xx xxx                # dynamic entry from dhcpd.leases                                                                                      
      ...

      
      Is there a bug somewhere? Or a limit on the number of static hosts? (We have 21 static DHCP entries and 24 static DNS forwarder entries.)
      1 Reply Last reply Reply Quote 0
      • M
        Mazzolino
        last edited by

        Solved the problem by removing the double section "# dhpleases automatically entered" from /etc/hosts manually.

        I can add new static leases again, and the hosts file is not truncated anymore.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.