`
sillycat
  • 浏览: 2536069 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

DNS Resolver on Server

 
阅读更多
DNS Resolver on Server
DNS - Domain Name System
Resolver Service can translate domain names to IP address. Usually ISP (Internet Service Provider) provides these settings automatically.
Famous public DNS
CloudFlare 1.1.1.1
Google. 8.8.8.8
Cisco.  208.67.222.222
Check my configuration file on MAC
> cat /etc/resolv.conf
#
# macOS Notice
#
# This file is not consulted for DNS hostname resolution, address
# resolution, or the DNS query routing mechanism used by most
# processes on this system.
#
# To view the DNS configuration used by this system, use:
#   scutil --dns
#
# SEE ALSO
#   dns-sd(1), scutil(8)
#
# This file is automatically generated.
#
domain wks.lsvid.com
nameserver 10.10.100.35
nameserver 10.10.100.45
nameserver 10.10.100.25
We can check that from Command Line as well
> scutil --dns | grep 'nameserver\[[0-9]*\]'
Get the DNS from Python
cat resolvconfReader.py
#!/usr/bin/env python
def get_resolvers():
resolvers = []
try:
with open( '/etc/resolv.conf', 'r' ) as resolvconf:
for line in resolvconf.readlines():
line = line.split( '#', 1 )[ 0 ];
line = line.rstrip();
if 'nameserver' in line:
resolvers.append( line.split()[ 1 ] )
return resolvers
except IOError as error:
return error.strerror
print( get_resolvers())
Easy python script to find that out
> python resolvconfReader.py
['10.10.100.35', '10.10.100.45', '10.10.100.25']

References:
https://superuser.com/questions/258151/how-do-i-check-what-dns-server-im-using-on-mac-os-x
https://github.com/donjajo/py-world/blob/master/resolvconfReader.py



分享到:
评论

相关推荐

    dns配置手册

    // ISC BIND named(8) DNS server as a caching only nameserver // (as a localhost DNS resolver only). options { listen-on port 53 { any; }; listen-on-v6 port 53 { ::1; }; directory "/var/named";...

    RHEL5--DNS智能策略解析

    view localhost_resolver { match-clients { localhost; }; match-destinations { localhost; }; recursion yes; include "/etc/named.rfc1912.zones"; }; acl "cnc" { 192.168.5.251/32; }; // 定义网通客户端...

    nginx代理转发配置,配置内网到外网访问

    #gzip on; server { #指定DNS服务器IP地址 resolver 8.8.8.8 valid=60s ipv6=off; #resolver 8.8.8.8; #监听443端口,https默认端口443 listen 8443; access_log /var/log/nginx/forward_proxy_...

    nginx配置优化

    2. **减少DNS查找时间**:使用IP地址代替域名,或者开启DNS缓存: ``` resolver 8.8.8.8 8.8.4.4 valid=300s; resolver_timeout 5s; ``` 3. **优化SSI(服务器端包含)**:合理使用SSI减少HTTP请求,但注意不要...

    Nginx的基本配置与优化

    7. **减少DNS查询时间**: DNS查询是耗时的操作之一,可以通过增加`resolver_timeout`和`resolver`选项来解决这个问题。 8. **限制连接数**: 对于恶意攻击,可以限制每个IP地址的连接数。 9. **利用SSL卸载**: 如果...

    lwip源码(小型TCP/IP协议栈)

    * DNS (Domain name resolver incl. mDNS) * 6LoWPAN (via IEEE 802.15.4, BLE or ZEP) APPLICATIONS * HTTP server with SSI and CGI (HTTPS via altcp) * SNMPv2c agent with MIB compiler (Simple Network...

    Solaris 10 System Administration Essentials

    13.3.1 Resolver Files 350 13.3.2 Steps DNS Clients Use to Resolve Names 350 13.4 NIS Setup and Con?guration 351 13.4.1 Setting Up NIS Clients 351 13.4.2 Working with NIS Maps 352 13.5 LDAP Setup and ...

    Nginx超时设置.docx

    - **resolver_timeout**:设置 DNS 解析的超时时间。这对于那些依赖于外部 DNS 服务的应用尤为重要,以避免因 DNS 解析失败导致的服务中断。 ##### 2. 后端服务器超时设置 - **proxy_connect_timeout**:与上游...

    mini2440 beer(pwm) 驱动

    Registering the dns_resolver key type s3c-rtc s3c2410-rtc: setting system clock to 2000-02-26 23:38:54 UTC (951608334) dm9000 dm9000: eth0: link down IP-Config: Complete: device=eth0, addr=192.168....

Global site tag (gtag.js) - Google Analytics