Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Hostname resolve on local network
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
davidshen84
Apprentice
Apprentice


Joined: 09 Aug 2008
Posts: 257

PostPosted: Sat Mar 11, 2017 2:31 pm    Post subject: Hostname resolve on local network Reply with quote

Hi,

My Gentoo is 64 bit, with systemd. I did not setup a local DNS service, neither did I configure my /etc/hosts for my system. But I found I can ping myself by using the host name directly. I wonder how the system resolved the hostname.

Also, I found it only works with ipv6, If I do ping6 <my host name>, it says "unknown host".

I use OpenWRT on my router. I found in the IPv4 DHCP lease table, it has my host name and ip listed. But in the IPv6 section, my system's host name is "?".

Do I need specific configuration to get hostname and ipv6 work together?


Thanks.
_________________
David Shen
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7050
Location: almost Mile High in the USA

PostPosted: Sun Mar 12, 2017 1:54 am    Post subject: Reply with quote

1. Some routers do DNS by DHCP requested name. It's a "nice" feature in some versions of router software (perhaps it's now a feature in dnsmasq) - for IPV4.
2. A lot of routers don't have DHCP6 set up properly and opt for using SLAAC. Using SLAAC instead of DHCP6, then the router really has no idea what your IPV6 hostname is.

So it looks like you're using OpenWRT...unfortunately that's something I don't have much info about. Oddly enough I currently know more about pfSense IPV6 than *WRT (i.e., Linux-based) IPV6 routing... ssshhh...

Granted just a hair more...
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Syl20
Guru
Guru


Joined: 04 Aug 2005
Posts: 550
Location: France

PostPosted: Mon Mar 13, 2017 9:41 am    Post subject: Re: Hostname resolve on local network Reply with quote

davidshen84 wrote:
But I found I can ping myself by using the host name directly. I wonder how the system resolved the hostname.

You can try a dig/nslookup request (net-dns/bind-tools). If the configured DNS server (probably your internet router/box) gives you the right answer, you know how. :wink:
Back to top
View user's profile Send private message
davidshen84
Apprentice
Apprentice


Joined: 09 Aug 2008
Posts: 257

PostPosted: Sun Mar 19, 2017 1:16 am    Post subject: Reply with quote

Hi Syl20,

Could you be more specific what am I suppose to look up? I tried dig as follow:

Code:
dig @fde4:c7f9:94a8::1 xps13 -6

; <<>> DiG 9.11.0-P3 <<>> @fde4:c7f9:94a8::1 xps13 -6
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 65074
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1280
;; QUESTION SECTION:
;xps13.                         IN      A

;; ANSWER SECTION:
xps13.                  0       IN      A       192.168.100.238

;; Query time: 2 msec
;; SERVER: fde4:c7f9:94a8::1#53(fde4:c7f9:94a8::1)
;; WHEN: Sun Mar 19 09:14:09 CST 2017
;; MSG SIZE  rcvd: 50



I queried my router using its ipv6 address, and I also provided the "-6" option, but the returned address is still ipv4 address. So I guess some ipv6 related configuration is mission on my laptop, or the router.
_________________
David Shen
Back to top
View user's profile Send private message
szatox
Veteran
Veteran


Joined: 27 Aug 2013
Posts: 1717

PostPosted: Sun Mar 19, 2017 10:12 am    Post subject: Reply with quote

Quote:

;; ANSWER SECTION:
xps13. 0 IN A 192.168.100.238

That's why you can ping your machine over ipv4 by name.
Your router's DNS did not provide ipv6 address for this name, so you need another way to discover your peers.

Good news is you can use avahi to achieve that. It uses multicast dns service for peer and service discovery, so every single node can introduce itself to the network instead of waiting for some authority to do that.
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 5591

PostPosted: Sun Mar 19, 2017 6:45 pm    Post subject: Reply with quote

The downside of avahi is that instead of no response for IPv6, you'll get a segfault instead. (unless you install =sys-auth/nss-mdns-9999)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum