mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-05-15 06:06:07 -06:00
[GH-ISSUE #234] Host name resolving problem for Mac #113
Labels
No labels
Xorg
documentation
enhancement
macos
pull-request
question
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/lan-mouse#113
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @pomelo on GitHub (Nov 12, 2024).
Original GitHub issue: https://github.com/feschber/lan-mouse/issues/234
Hi there,
I need help for setting up lan-mouse running on two of my mac devices: an Intel MBP 2014 (macOS 12.7.6) and an M1 Pro MBP (macOS 15.1).
I found lan-mouse couldn't resolve the hostname that ends with
.lanor.local. If I don't provide the hostname in the configuration files but useipslist, it works. The only problem is both of them are running with DHCP client, so I have to change the IP list from time to time.The toml file is as below:
And the logs are:
@feschber commented on GitHub (Nov 12, 2024):
I recall that using the
.localTLD is discouraged on MacOS because it is used for mDNS.See https://en.wikipedia.org/wiki/.local or https://superuser.com/questions/1828456/macos-cannot-access-custom-local-domain.
With
.lanI don't know why that should be a problem though. Could you verify that the.landomains actually cause problems as well?@pomelo commented on GitHub (Nov 13, 2024):
@feschber Thanks for the replying. The problem is, I can't modify the
.localsuffix, it is grayed out in the Settings, and if I setW-Silicon.lanfor local hostname, then it says 'The Bonjour Name is invalid.' and won't save the changes.And you are correct, the
.landomain is working, so that I can move the cursor from the Apple Silicon MBP to the old Intel MBP. However, soon after I typed a few letters, the client mac (old intel one) got repeatedly key stroke, and even ctrl-d / ctrl-c wouldn't work to terminate the lan-mouse process, and I can only kill it from Activity Monitor. I thought it was a release bind problem, so I commented it out but the problem was not resolved.Here are the logs:
@porelli commented on GitHub (Nov 19, 2024):
I have a similar problem. The '.local. is what Bonjour normally uses but even setting the correct hostname lan-mouse doesn't seem able to resolve while dig can... It seems like lan-mouse only wants to connect to an IPv6?
@SMQuazi commented on GitHub (Oct 19, 2025):
Having this problem atm. Anyone find a solution or workaround? I can't seem to find a way to change the .local on my macbook. Nor an option to change it from my router.
@feschber commented on GitHub (Oct 19, 2025):
As a workaround, you should be able to use an IP address instead @SMQuazi
@nbolton commented on GitHub (Oct 21, 2025):
I normally use
.lan(for the reasons @feschber mentioned) but actually it seemed to revert to.localtoday (maybe a recent macOS update forced it?)Anyway, I ran
sudo scutil --set HostName whirlyjig.lan(replacewhirlyjigwith your hostname) and it changed the output ofhostnamecorrectly.@reasonz commented on GitHub (Oct 24, 2025):
#!/bin/bash
set -e
HOST_NAME="omarchy.local"
CONFIG_PATH="/tmp/lan-mouse-server.toml"
PORT=4242
echo "🔍 正在解析 $HOST_NAME 的 IP..."
用 ping -c1 方式快速解析 mDNS(只发 1 个包,1 秒超时)
SERVER_IP=$(ping -c1 -t1 "$HOST_NAME" 2>/dev/null | grep -oE '([0-9]+.[0-9]+.[0-9]+.[0-9]+)' | tr -d '()')
if [ -z "$SERVER_IP" ]; then
echo "❌ 无法解析 $HOST_NAME,请检查 Linux 端是否开启 mDNS(avahi-daemon)。"
exit 1
fi
echo "✅ 对方 IP: $SERVER_IP"
=== 生成配置文件 ===
mkdir -p "$(dirname "$CONFIG_PATH")"
cat > "$CONFIG_PATH" <<EOF
port = $PORT
release_bind = ["KeyA", "KeyS", "KeyD", "KeyF"]
clients
position = "$POSITION"
hostname = "$PEER_HOSTNAME"
ips = ["$SERVER_IP"]
activate_on_startup = true
EOF
echo "✅ 已生成配置文件: $CONFIG_PATH"
=== 启动 lan-mouse ===
echo "🚀 启动 lan-mouse ..."
/Applications/lan-mouse-macos-aarch64 --frontend cli --config "$CONFIG_PATH"
@jondkinney commented on GitHub (Apr 29, 2026):
This is what I had to resort to. Using the IP works for me for now.