Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Host name resolving problem for Mac #234

Open
pomelo opened this issue Nov 12, 2024 · 3 comments
Open

Host name resolving problem for Mac #234

pomelo opened this issue Nov 12, 2024 · 3 comments

Comments

@pomelo
Copy link

pomelo commented Nov 12, 2024

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 .lan or .local. If I don't provide the hostname in the configuration files but use ips list, 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:

# configure release bind
release_bind = [ "KeyA", "KeyS", "KeyD", "KeyF" ]
# port = 4242

# optional frontend -> defaults to gtk if available
# possible values are "cli" and "gtk" 
frontend = "cli"

[left]

# hostname
hostname = "W-Silicon.local"
activate_on_startup = true
ips = ["192.168.1.211"]

And the logs are:

[2024-11-12T09:49:27Z INFO  lan_mouse::config] using config: "/Users/wayne/.config/lan-mouse/config.toml"
[2024-11-12T09:49:27Z INFO  lan_mouse] release bind: [KeyA, KeyS, KeyD, KeyF]
[2024-11-12T09:49:27Z INFO  lan_mouse::config] using config: "/Users/wayne/.config/lan-mouse/config.toml"
[2024-11-12T09:49:27Z INFO  lan_mouse] release bind: [KeyA, KeyS, KeyD, KeyF]
[2024-11-12T09:49:27Z INFO  lan_mouse] Press [KeyA, KeyS, KeyD, KeyF] to release the mouse
[2024-11-12T09:49:27Z INFO  input_capture::macos] Enabling CGEvent tap
[2024-11-12T09:49:27Z INFO  input_capture] using capture backend: MacOS
[2024-11-12T09:49:27Z INFO  lan_mouse::server::emulation_task] creating input emulation...
[2024-11-12T09:49:27Z INFO  input_emulation] using emulation backend: macos
[2024-11-12T09:49:27Z INFO  lan_mouse::dns] resolving (0) `W-Silicon.local` ...
lan-mouse > emulation status: Enabled
lan-mouse > capture status: Enabled
lan-mouse > changed port to 4242
lan-mouse > [2024-11-12T09:49:27Z WARN  lan_mouse::dns] could not resolve host 'W-Silicon.local': no record found for Query { name: Name("w-silicon.local.lan."), query_type: AAAA, query_class: IN }
lan-mouse > [2024-11-12T09:49:28Z WARN  lan_mouse::server::ping_task] client not responding, releasing pointer!
[2024-11-12T09:49:30Z WARN  lan_mouse::server::ping_task] client not responding, releasing pointer!
[2024-11-12T09:49:35Z WARN  lan_mouse::server::ping_task] client not responding, releasing pointer!
[2024-11-12T09:49:36Z WARN  lan_mouse::server::ping_task] client not responding, releasing pointer!
[2024-11-12T09:49:38Z INFO  lan_mouse::server] terminating service
[2024-11-12T09:49:38Z INFO  lan_mouse] service exited!
@feschber
Copy link
Owner

I recall that using the .local TLD 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 .lan I don't know why that should be a problem though. Could you verify that the .lan domains actually cause problems as well?

@pomelo
Copy link
Author

pomelo commented Nov 13, 2024

@feschber Thanks for the replying. The problem is, I can't modify the .local suffix, it is grayed out in the Settings, and if I set W-Silicon.lan for local hostname, then it says 'The Bonjour Name is invalid.' and won't save the changes.

And you are correct, the .lan domain 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:

wayne@Waynes-MBP ~> lan-mouse                                                                                                                                                                [2024-11-13T09:29:46Z INFO  lan_mouse::config] using config: "/Users/wayne/.config/lan-mouse/config.toml"
[2024-11-13T09:29:46Z INFO  lan_mouse] release bind: [KeyLeftCtrl, KeyLeftShift, KeyLeftMeta, KeyLeftAlt]
[2024-11-13T09:29:46Z INFO  lan_mouse::config] using config: "/Users/wayne/.config/lan-mouse/config.toml"
[2024-11-13T09:29:46Z INFO  lan_mouse] release bind: [KeyLeftCtrl, KeyLeftShift, KeyLeftMeta, KeyLeftAlt]
[2024-11-13T09:29:46Z INFO  lan_mouse] Press [KeyLeftCtrl, KeyLeftShift, KeyLeftMeta, KeyLeftAlt] to release the mouse
[2024-11-13T09:29:46Z INFO  input_capture::macos] Enabling CGEvent tap
[2024-11-13T09:29:46Z INFO  input_capture] using capture backend: MacOS
[2024-11-13T09:29:46Z INFO  lan_mouse::server::emulation_task] creating input emulation...
[2024-11-13T09:29:46Z INFO  input_emulation] using emulation backend: macos
[2024-11-13T09:29:46Z INFO  lan_mouse::dns] resolving (0) `W-Silicon.local` ...
lan-mouse > emulation status: Enabled
lan-mouse > capture status: Enabled
lan-mouse > changed port to 4242
lan-mouse > [2024-11-13T09:29:46Z WARN  lan_mouse::dns] could not resolve host 'W-Silicon.local': no record found for Query { name: Name("w-silicon.local.lan."), query_type: AAAA, query_class: IN }
lan-mouse > aasdf[2024-11-13T09:29:59Z WARN  lan_mouse::server::ping_task] device not responding, releasing keys!
fffffffffffffff[2024-11-13T09:29:59Z WARN  lan_mouse::server::ping_task] device not responding, releasing keys!
fffffffffffffff[2024-11-13T09:30:00Z WARN  lan_mouse::server::ping_task] device not responding, releasing keys!
fffffffffffffff[2024-11-13T09:30:00Z WARN  lan_mouse::server::ping_task] device not responding, releasing keys!
fffffffffffffff[2024-11-13T09:30:01Z WARN  lan_mouse::server::ping_task] device not responding, releasing keys!
fffffffffffffff[2024-11-13T09:30:01Z WARN  lan_mouse::server::ping_task] device not responding, releasing keys!
fffffffffffffff[2024-11-13T09:30:02Z WARN  lan_mouse::server::ping_task] device not responding, releasing keys!
fffffffffffffff[2024-11-13T09:30:02Z WARN  lan_mouse::server::ping_task] device not responding, releasing keys!
fffffffffffffff[2024-11-13T09:30:03Z WARN  lan_mouse::server::ping_task] device not responding, releasing keys!
fffffffffffffff[2024-11-13T09:30:03Z WARN  lan_mouse::server::ping_task] device not responding, releasing keys!
fffffffffffffff[2024-11-13T09:30:04Z WARN  lan_mouse::server::ping_task] device not responding, releasing keys!
fffffffffffffff[2024-11-13T09:30:04Z WARN  lan_mouse::server::ping_task] device not responding, releasing keys!
fffffffffffffff[2024-11-13T09:30:05Z WARN  lan_mouse::server::ping_task] device not responding, releasing keys!

@porelli
Copy link

porelli commented 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?

[2024-11-19T15:02:12Z INFO  lan_mouse::dns] resolving (0) `mac1.my-domain.com` ...
[2024-11-19T15:02:42Z WARN  lan_mouse::dns] could not resolve host 'mac1.my-domain.com': no record found for Query { name: Name("mac1.my-domain.com.my-domain.com."), query_type: AAAA, query_class: IN }
 ~ > dig mac1.my-domain.com 

; <<>> DiG 9.10.6 <<>> mac1.my-domain.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 48285
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;mac1.my-domain.com. IN	A

;; ANSWER SECTION:
mac1.my-domain.com. 0 IN	A	192.168.1.2

;; Query time: 3 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Tue Nov 19 07:03:00 PST 2024
;; MSG SIZE  rcvd: 78

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants