Local DNS problems on Sequoia with Firefox and Safari

I spend 3 days to debug not loading some of my local homelab sites.
I have local DNS server on LAN which overrides all A/CNAME record IPs for services I host.
This allows me to directly talk to host next to my devices, instead to go via router or via public network.

After updating to macOS Sequoia 15.2, few of my sites were broken on Firefox and Safari.
On Brave it still worked ok.

I fiddled with OS settings → Privacy & Security → Local Network permissions.
My theory was, after OS upgrade something maybe glitched with access to private network.
I switched many times on/off. Rebooted. Nothing.
I uninstalled Firefox after backing up profile. Turned off laptop completely. Installed again.
Prompt with allowing local network showed, but it still was broken.

Next suspect, I was convinced that Firefox uses DoH or DoT instead of my local resolver.
I used about:networking#dns and resolving showed public IP instead of private IP I expected for my domain. Weird, so it must be on OS side, not browser!

I checked resolving DNS with dig before, but it seems that it uses other path in OS as it always returned proper local IP, even without targeting DNS server.

Proper way to debug DNS on macOS was to use:

dscacheutil -q host -a name example.com

Output showed me, that resolved IP is my public IP, not private LAN IP as I expected

name: example.com
ip_address: X.X.X.X

After seeing this, I instantly remembered, some months ago, on other laptop (from work) I got SSH problems when private relay was turned on.
I turned off private relay in OS settings → account (icon on top with avatar) → iCloud → Private Relay → Off.

It worked again instantly!

Sleep

Disable sleep
https://old.reddit.com/r/mac/comments/14ta4uf/using_m1_macbook_air_as_home_server_keeps_going/

sudo pmset -g
sudo pmset -a disablesleep 1 

Memory pressure

Colors in activity monitor:

  • Green : Between 100% and 50% of free memory
  • Yellow : Between 50 and 30% of free memory
  • Red : Between 30% and 0% of free memory

image

image

Source and logging memory pressure:
https://medium.com/@laclementine/daily-logs-for-memory-pressure-and-swap-in-macos-f5b09d67c523

#!/bin/bash  
  
###  
#  
#                Author : La Clémentine · https://medium.com/@laclementine/  
#               Created : 2021-02-26  
#         Last Modified : 2023-08-26  
#               Version : 1.0  
#           Tested with : macOS 13.5.1  
#  
###  
  
current_user=$(stat -f %Su /dev/console)  
memory_pressure="$(memory_pressure | grep "System-wide" | awk '{ print $5 }')"  
swap=$(sysctl vm.swapusage | awk '{print $7}')  
date=$(date +'%Y-%m-%d')  
time=$(date +'%H:%M:%S')  
  
# Create txt file  
if [ ! -f "/Users/Shared/memory-logs-$date.txt" ]; then  
 echo "Creating today's memory logs"  
 touch "/Users/Shared/memory-logs-$date.txt"  
 echo "Time       Free Memory  Swap" >> "/Users/Shared/memory-logs-$date.txt"  
 chown "$current_user" "/Users/Shared/memory-logs-$date.txt"  
fi  
  
# Write current free memory and swap into txt  
echo "$time   $memory_pressure          $swap" >> "/Users/Shared/memory-logs-$date.txt"  
  
# Show the entire daily logs  
echo  
cat "/Users/Shared/memory-logs-$date.txt"
#!/bin/bash  
  
###  
#  
#                Author : La Clémentine · https://medium.com/@laclementine/  
#               Created : 2021-02-26  
#         Last Modified : 2023-08-26  
#               Version : 1.0  
#           Tested with : macOS 13.5.1  
#  
###  
  
memory_pressure="$(memory_pressure | grep "System-wide" | awk '{ print $5 }')"  
swap=$(sysctl vm.swapusage | awk '{print $7}')  
  
echo "<result>$memory_pressure · $swap</result>"

No garbage (lol)

Where is trash icon, how to enter recycle bin
https://discussions.apple.com/thread/250562486?sortBy=best
This thread didn’t help

https://old.reddit.com/r/MacOS/comments/15vagks/how_can_i_remove_the_recents_from_finder/
Finder → Settings → General tab → New Finder windows show

# Open trash
# Open recycle bin
# Open bin
osascript -e 'tell application "Finder" to open trash'

Move files in Finder
Cmd + C
Cmd + Option + V
https://discussions.apple.com/thread/254648745?sortBy=best

Use copy-on-write on APFS by copying by finder or using
https://news.ycombinator.com/item?id=40383537

cp -c

Navigate via keyboard in confirm delete popup too

System Preferences → Keyboard → Shortcuts → Use Keyboard navigation to move focus between controls.
https://old.reddit.com/r/osx/comments/s6pwbs/keyboard_shortcut_for_confirm_delete/

entering a file path into Finder or elsewhere

You can type Command + Shift + g while in any Finder window or select “Go to Folder…” from the “Go” menu & type in or paste in a filepath. Press the “Go” button & you are there.
https://discussions.apple.com/thread/3911493?sortBy=rank

Misc

cleanup startup items (at boot)
via GUI, Settings → General → Login items
via CLI

launchctl list | grep -v com.apple
launchctl remove org.keepassxc.KeePassXC

related, xrite uninstall
https://discussions.apple.com/thread/8370096?sortBy=rank

Automation withLua
https://github.com/Hammerspoon/hammerspoon

Useful built-in macOS command-line utilities
https://news.ycombinator.com/item?id=42057431
https://weiyen.net/articles/useful-macos-cmd-line-utilities