Pages

Monday, December 27, 2010

How to configure DNS client

You can use below procedure to configure host as DNS client. In this example you already have DNS server

  1. Modify your /etc/nsswitch.conf file to include DNS. For instance, you can copy from /etc/nsswitch.dns
    root@solaris-sunray # cp /etc/nsswitch.dns /etc/nsswitch.conf
  2. Modify your /etc/resolv.conf to include IP address of your DNS server. In this example, your DNS server IP address is 172.16.20.249
    root@solaris-sunray # vi /etc/resolv.conf
     nameserver 172.16.20.249
     domain sun.com
     search sun.com
  1. Make sure that your DNS client service is running.
    root@solaris-sunray # svcadm enable svc:/network/dns/client:default
  2. Set your client domain name.
    root@solaris-sunray # vi /etc/defaultdomain
     sun.com
     # domainname sun.com
  1. Test your DNS client configuration. Look IP address of server pool.ntp.org
    root@solaris-sunray # nslookup pool.ntp.org
    Server: 172.16.20.249
    Address: 172.16.20.249#53
    Non-authoritative answer:
    Name: pool.ntp.org
    Address: 202.134.6.170
    Name: pool.ntp.org
    Address: 152.118.24.8
    root@solaris-sunray # dig pool.ntp.org
    ; <<>> DiG 9.3.4-P1 <<>> pool.ntp.org
    ;; global options: printcmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 1371
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 9, ADDITIONAL: 12
    ;; QUESTION SECTION:
    ;pool.ntp.org. IN A
    ;; ANSWER SECTION:
    pool.ntp.org. 270 IN A 152.118.24.8
    pool.ntp.org. 270 IN A 202.134.6.170
    ;; AUTHORITY SECTION:
    pool.ntp.org. 3122 IN NS d.ntpns.org.
    pool.ntp.org. 3122 IN NS e.ntpns.org.
    pool.ntp.org. 3122 IN NS f.ntpns.org.
    pool.ntp.org. 3122 IN NS g.ntpns.org.
    pool.ntp.org. 3122 IN NS h.ntpns.org.
    pool.ntp.org. 3122 IN NS i.ntpns.org.
    pool.ntp.org. 3122 IN NS a.ntpns.org.
    pool.ntp.org. 3122 IN NS b.ntpns.org.
    pool.ntp.org. 3122 IN NS c.ntpns.org.
    ;; ADDITIONAL SECTION:
    a.ntpns.org. 16553 IN A 207.171.17.42
    b.ntpns.org. 6723 IN A 207.171.7.84
    c.ntpns.org. 16553 IN A 212.200.82.148
    d.ntpns.org. 16553 IN A 94.23.191.112
    e.ntpns.org. 16553 IN A 70.85.157.108
    f.ntpns.org. 16553 IN A 202.191.108.134
    g.ntpns.org. 16553 IN A 78.153.203.28
    h.ntpns.org. 16553 IN A 64.142.113.8
    h.ntpns.org. 16553 IN A 85.214.25.217
    h.ntpns.org. 16553 IN A 212.12.50.229
    i.ntpns.org. 16553 IN A 141.89.226.53
    i.ntpns.org. 16553 IN AAAA 2001:638:807:201:215:5dff:fee2:700c
    ;; Query time: 261 msec
    ;; SERVER: 172.16.20.249#53(172.16.20.249)
    ;; WHEN: Thu Nov 11 16:09:54 2010
    ;; MSG SIZE rcvd: 416

No comments:

Post a Comment