2

My local network name is usually myhostname.local, but sometimes other people on the network can't access me at that address and I have to give them my network IP address (which changes).

How can I confirm my name on the network I am currently logged in to?

2 Answers 2

1

All this mDNS/Ahavi stuff is very platform dependent. Your computer will advertise its hostname but it's the other computers that set its DNS name on themselves.

  • Avahi sticks .local on the end,
  • Bonjour (the Apple implementation) doesn't bother with the .local, and
  • NetBIOS isn't really mDNS but it's how Windows and Samba spreads its name. Again, no .local

If you're sitting in a network of a single, controlled platform, the answer is fairly simple... If you aren't, it's not.

If this is a common issue, and it's a network you control, it might be worth setting real DNS for your computers through a centralised DNS server and having that add DHCP leases to that. pdnsd is something I've looked at before but there are others.

Note: If the router isn't industrial, you'll need to check you can set the DNS server to an internal IP. I had issues with that very issue on a Netgear router and never managed to work around it.

Failing that, external services (Dyndns et al) could let you set local, illegal IPs to real domain names. Eg you could be resolved through d3vid-internal.d3vidsdomain.etx.

2
  • thanks, it helps to know which direction to tackle the problem from! so now I need to go on Super User, Ask Different, Android Enthusiasts and Seasoned Advice to ask "how can I find a hostname given an IP address?" ... well, Seasoned Advice only once I get a smart fridge ;)
    – lofidevops
    Mar 10, 2014 at 11:52
  • it's a commonish issue on networks I don't control :(
    – lofidevops
    Mar 10, 2014 at 11:52
1

After some digging around...

  1. Run ifconfig and identify which device is connected to the network you're interested in. For example, if you are connected to a WLAN it would be wlan0. Get your IP address on that device.

  2. Run avahi-resolve-host-name -a 123.45.678.900 (where the numbers are your IP address). This should display:

    123.45.678.900    yourhostname.local

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .