Monday Aug 11, 2008

Local Hostname Resolution

OpenSolaris only allows me to ping machines in my local network by IP address:

bleonard@opensolaris:/etc$ ping 10.0.1.200
10.0.1.200 is alive
bleonard@opensolaris:/etc$ ping -s integrity.local
ping: unknown host integrity.local
bleonard@opensolaris:/etc$ 
While doing some digging I found the Service Discovery project, which uses Multicast DNS (mDNS) to locate services on the network. mDNS is managed by SMF and disabled by default. To use it, first copy the /etc/nsswitch.dns file to /etc/nsswitch.conf:
cd /etc 
pfexec cp nsswitch.conf nsswitch.conf.orig
pfexec cp nsswitch.dns nsswitch.conf

Then enable the mDNS service:

svcadm enable /network/dns/multicast

Now the hostnames on your local network are properly resolved:

bleonard@opensolaris:/etc$ ping -s integrity.local
PING integrity.local: 56 data bytes
64 bytes from 10.0.1.200: icmp_seq=0. time=1.011 ms
64 bytes from 10.0.1.200: icmp_seq=1. time=1.009 ms
64 bytes from 10.0.1.200: icmp_seq=2. time=0.939 ms
64 bytes from 10.0.1.200: icmp_seq=3. time=0.985 ms
\^C
----integrity.local PING Statistics----
4 packets transmitted, 4 packets received, 0% packet loss
round-trip (ms)  min/avg/max/stddev = 0.939/0.986/1.011/0.033
bleonard@opensolaris:/etc$

This is great because the IP addresses are assigned by DHCP, so I no longer have to keep track of changing IP addresses.

About

The Observatory is a blog for users of Oracle Solaris. Tune in here for tips, tricks and more as we explore the Solaris operating system from Oracle.

Connect with Oracle Solaris:


Search

Archives
« July 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  
       
Today