rm noneed

This commit is contained in:
zu1k 2020-07-19 07:41:58 +08:00
parent ada57ac6d9
commit a7a42823c0
3 changed files with 27 additions and 0 deletions

View File

@ -162,6 +162,25 @@ Name: zgovweb.v.bsgslb.cn [白山云 CDN]
Address: 2001:428:6402:21b::5
```
#### Also parse IP geo
```
➜ nali git:(master) ✗ nslookup www.gov.cn | nali
Server: 127.0.0.53 [局域网 IP]
Address: 127.0.0.53 [局域网 IP]#53
Non-authoritative answer:
www.gov.cn canonical name = www.gov.cn.bsgslb.cn [白山云 CDN].
www.gov.cn.bsgslb.cn [白山云 CDN] canonical name = zgovweb.v.bsgslb.cn [白山云 CDN].
Name: zgovweb.v.bsgslb.cn [白山云 CDN]
Address: 103.104.170.25 [新加坡 CZ88.NET]
Name: zgovweb.v.bsgslb.cn [白山云 CDN]
Address: 2001:428:6402:21b::5 [美国Louisiana州Monroe Qwest Communications Company, LLC (CenturyLink)]
Name: zgovweb.v.bsgslb.cn [白山云 CDN]
Address: 2001:428:6402:21b::6 [美国Louisiana州Monroe Qwest Communications Company, LLC (CenturyLink)]
```
#### Use standalone
You should parse cname by yourself

View File

@ -105,6 +105,9 @@ func (db QQwry) Find(ip string) (res string) {
country, _ := enc.String(string(gbkCountry))
area, _ := enc.String(string(gbkArea))
country = strings.ReplaceAll(country, " CZ88.NET", "")
area = strings.ReplaceAll(area, " CZ88.NET", "")
return fmt.Sprintf("%s %s", country, area)
}

View File

@ -8,6 +8,7 @@ import (
"math/big"
"net"
"os"
"strings"
"github.com/zu1k/nali/pkg/common"
)
@ -63,6 +64,10 @@ func (db ZXwry) Find(ip string) (result string) {
ipv6 := op.Uint64()
offset := db.searchIndex(ipv6)
country, area := db.getAddr(offset)
country = strings.ReplaceAll(country, " CZ88.NET", "")
area = strings.ReplaceAll(area, " CZ88.NET", "")
return fmt.Sprintf("%s %s", country, area)
}