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

os.hostname() returns hostname + tld on osx #61

Open
pkpowell opened this issue Sep 28, 2019 · 0 comments
Open

os.hostname() returns hostname + tld on osx #61

pkpowell opened this issue Sep 28, 2019 · 0 comments

Comments

@pkpowell
Copy link

This leads to strange hostnames with double tlds like machine.local.local, machine.lan.local etc when registering services on the macs I've tested (10.11 through 10.14, go v1.13.1).
hostname on the cli appears to exhibit the same behaviour, i.e. on a mac it returns machine.lan vs machine on linux, so maybe the issue is that os.Hostname() doesn't accept flags.
Not sure where this should be fixed. I've "hacked" a solution which seems to work: entry.HostName = strings.Split(entry.HostName, ".")[0], but am pretty sure this will break at some point.
Any ideas?

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

1 participant