# IPv6 nslookup etc not working



## AndyUKG (May 12, 2010)

Hi,

  IÂ´m in the process of testing BIND 9.7.0.1 (from ports) on FreeBSD 8.0 with IPv6.
The system has both IPv4 and IPv6 IP address, both are working. I found after adding some AAAA records I was getting errors looking them up, but I could look them up from a Windows 7 laptop :S
On further digging I have tested with a public IPv6 forward DNS record:

altavista.ipv6.digital.com

My FreeBSD fails if I attempt to do a lookup on this via nslookup, equally fails a ping. However a valid AAAA records exists which I can see from Windows 7 and also via a dig from FreeBSD. 

I have replaced base BIND with BIND 9.7 and chosen to force IPv6 support. I can see by the datestamp on my nslookup binary its just been compiled. So whats the problem? I had a look on the freebsd site at the IPv6 guide and dont see any reference to having to make special changes to be able to see IPv6 DNS records....

thanks, Andy.


----------



## SirDice (May 12, 2010)

Do you have IPv6 enabled in rc.conf?


```
dice@molly:~>nslookup
> server 192.168.1.1
Default server: 192.168.1.1
Address: 192.168.1.1#53
> set querytype=any
> molly
Server:         192.168.1.1
Address:        192.168.1.1#53

Name:   molly.dicelan.home
Address: 192.168.1.190
molly.dicelan.home      has AAAA address 2001:888:1c5b::190
```


----------



## AndyUKG (May 12, 2010)

Yep, I have in rc.conf:


```
ipv6_ifconfig_em0="xxxx:170:0:1::43"
ipv6_defaultrouter="xxxx:170:0:1::1"
ipv6_enable="YES"
```

(Obfuscated IPs)


The same syntax, ie specify querytype=any also works for me (as does dig as I mentioned)


```
# nslookup
> server localhost
Default server: localhost
Address: ::1#53
Default server: localhost
Address: 127.0.0.1#53
> set querytype=any
> altavista.ipv6.digital.com
Server:         localhost
Address:        127.0.0.1#53

Non-authoritative answer:
altavista.ipv6.digital.com      has AAAA address 3ffe:1200:2001:1:8000::1

Authoritative answers can be found from:
ipv6.digital.com        nameserver = crl.dec.com.
ipv6.digital.com        nameserver = ns.dec.com.
ns.dec.com      internet address = 15.243.224.21
```

However isnt it normal to expect nslookup, and more importantly ping, to work normally with IPv6 addresses?


----------



## SirDice (May 12, 2010)

AndyUKG said:
			
		

> However isnt it normal to expect nslookup, and more importantly ping, to work normally with IPv6 addresses?


The default querytype is A, not AAAA. Also instead of ping use ping6.


----------



## AndyUKG (May 12, 2010)

Ah, ping6 I didnt know! 
Ok so all working as expected I suppose!
There isnÂ´t a way to configure DNS to do both A and AAAA lookups by default is there? 

thanks for the info, Andy.


----------



## SirDice (May 12, 2010)

AndyUKG said:
			
		

> There isnÂ´t a way to configure DNS to do both A and AAAA lookups by default is there?


It will depend on the application that's doing the query. Most IPv6 aware applications do.


----------



## AndyUKG (May 12, 2010)

PS what is the best way to suggest updates to handbook documentation? The IPv6 section makes no reference to ping6 which IMO is fairly fundamental. Should I email doc@FreeBSD.org ?


----------



## AndyUKG (May 12, 2010)

SirDice said:
			
		

> It will depend on the application that's doing the query. Most IPv6 aware applications do.



Sorry I meant to ask regarding specifically nslookup. Perhaps thats a question for the BIND forum?


----------



## SirDice (May 12, 2010)

AndyUKG said:
			
		

> Sorry I meant to ask regarding specifically nslookup. Perhaps thats a question for the BIND forum?



It's rather irrelevant what the nslookup tool does. Applications will use API calls anyway.


----------



## AndyUKG (May 12, 2010)

SirDice said:
			
		

> It's rather irrelevant what the nslookup tool does. Applications will use API calls anyway.



I wouldnt say it was irrelevant as nslookup is a vast number of UNIX admins in the world are used to using. It might be irrelevant for the actual functioning of the server.


----------



## SirDice (May 12, 2010)

AndyUKG said:
			
		

> I wouldnt say it was irrelevant as nslookup is a vast number of UNIX admins in the world are used to using.


They should also know about setting the querytype 



> It might be irrelevant for the actual functioning of the server.


It is.


----------



## AndyUKG (May 12, 2010)

SirDice said:
			
		

> They should also know about setting the querytype



Yeah, but the query type option means u can no longer use nslookup as a one line (non interactive) command and generally makes it cumbersome to use... Which is why I was wondering about configuring it to automatically check both A and AAAA records.


----------



## SirDice (May 12, 2010)

AndyUKG said:
			
		

> Yeah, but the query type option means u can no longer use nslookup as a one line (non interactive) command and generally makes it cumbersome to use...


Read the man page. `$ nslookup -q=AAAA [url]http://www.jp.freebsd.org[/url]` works fine.


----------



## AndyUKG (May 12, 2010)

SirDice said:
			
		

> Read the man page. `$ nslookup -q=AAAA [url]http://www.jp.freebsd.org[/url]` works fine.



Fair enough. Its still a more cumbersome command and means you have to check twice for all records .
Just seems like IPv6 is a bit of a second class citizen on FreeBSD, with different ping commands and not checking AAAA records by default. CanÂ´t say I have experience using IPv6 on other OSs tho to be fair, I only know nslookup on windows will check both A and AAAA records...


----------



## SirDice (May 12, 2010)

To be honest I'm assuming people who use tools to diagnose problems (the intended use of ping and nslookup) also know _how_ to use them. 

I'm more concerned about the behavior of Firefox for instance. And firefox will query both and will connect to the IPv6 address if both are available.


----------



## DutchDaemon (May 12, 2010)

BTW: nslookup is deprecated (and on its way out), use host or dig. To suggest additions to the documentation, you can file a PR in the docs section.


----------



## AndyUKG (May 12, 2010)

Thanks DD. Ive submitted my suggestion re the handbook.
PS yeah I know its on its way out, but it has been for years. Im sure most sys admins still use it  Guess weÂ´ll have to script a new nslookup when its really gone!


----------



## SirDice (May 12, 2010)

AndyUKG said:
			
		

> PS yeah I know its on its way out, but it has been for years. Im sure most sys admins still use it  Guess weÂ´ll have to script a new nslookup when its really gone!


I do still use it 

Mainly interactive though. For everything else dig. I like the interactive mode to hop from one DNS server to the other. Do a query, hop to another, etc. Perfect for hunting bad guys :e

I'm sure we can script something around dig when it does finally die


----------

