# Whois source



## caban (Jun 19, 2010)

I research sources of whois
/usr/src/usr.bin/whois and
I do not understand, for what this code?

```
if (strlen(domain) > sizeof("-NORID")-1 &&
            strcasecmp(domain + strlen(domain) - sizeof("-NORID") + 1,
                "-NORID") == 0) {
                s_asprintf(&retval, "%s", NORIDHOST);
                return (retval);
        }
```


----------



## gordon@ (Jun 19, 2010)

If you do a whois on "FOO-NORID", it will apparently ask the NORID server "whois.norid.no"

Apparently all NORID registered user handles have the -NORID suffix, so our whois takes care of that.

The change can be found at:
http://svn.freebsd.org/viewvc/base/head/usr.bin/whois/whois.c?r1=111430&r2=112617

You do know that whois works for more than just domain names? You can ask about handles. For example:


```
$ whois norid.no
...
Domain Information

Domain Name................: norid.no
Organization Handle........: UNA31O-NORID
Registrar Handle...........: REG2-NORID
Legal-c Handle.............: HT60P-NORID
Tech-c Handle..............: HT60P-NORID
Zone-c Handle..............: UH1R-NORID
Nameserver Handle..........: NN1H-NORID
Nameserver Handle..........: NAC1H-NORID
Nameserver Handle..........: BIFF1H-NORID
Nameserver Handle..........: SERV19H-NORID
...

$ whois UNA31O-NORID
...
Organization Information

NORID Handle...............: UNA31O-NORID
Organization Name..........: UNINETT NORID AS
Organization Number........: 985821585
Post Address...............: Abelsgate 5
Postal Code................: N-7465
Postal Area................: Trondheim
Country....................: Norway
...
```

Since the naming convention is so regular, our whois implementation takes advantage of it and does the right thing.


----------



## caban (Jun 20, 2010)

> You can ask about handles.


Did you mean nic-handle?
If yes, what about another nic-handles (e.g. CVB32-UANIC for yandex.ua)?


----------



## gordon@ (Jun 20, 2010)

I would say no one has added it to whois.


----------

