我想从我的c#/ java程序中获取域名的whois信息.有一个简单的方法吗?
我想查询DNS记录,直到获得正确的域名.
例如,给定www.subdomain.site.com.br,能够从.br挖掘到site.com.br.
实现这一目标的最多(以协议为导向)方式是什么?使用dig/nslookup的配方是最好的.
谢谢.
我想在我的VPS中使用相同的ip和端口绑定两个不同的域,这是我的httpd.conf:
<VirtualHost 106.187.96.123:80>
DocumentRoot /home/roy/sobuhu
ServerName aaa.com
</VirtualHost>
<VirtualHost 106.187.96.123:80>
DocumentRoot /disk1/allen/www
ServerName bbb.com
</VirtualHost>
<VirtualHost 106.187.96.123:80>
DocumentRoot /disk1/allen/www
ServerName www.bbb.com
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
我可以配置像@ .bbb.com这样的ServerName使用语法吗?所以我可以访问www.bbb.com,bbs.bbb.com DocumentRoot /disk1/allen/www.
现在我访问bbs.bbb.com,它将转向/home/roy/sobuhu.
我们有一个全名域名,例如long-domainname.com ; 此域名将替换为别名short.可以使用netapi32.dll这样的方法检索此别名:
[DllImport("Netapi32.dll")]
static extern int NetApiBufferFree(IntPtr Buffer);
// Returns the domain name the computer is joined to, or "" if not joined.
public static string GetJoinedDomain()
{
int result = 0;
string domain = null;
IntPtr pDomain = IntPtr.Zero;
NetJoinStatus status = NetJoinStatus.NetSetupUnknownStatus;
try
{
result = NetGetJoinInformation(null, out pDomain, out status);
if (result == ErrorSuccess &&
status == NetJoinStatus.NetSetupDomainName)
{
domain = Marshal.PtrToStringAuto(pDomain);
}
}
finally
{
if (pDomain != IntPtr.Zero) NetApiBufferFree(pDomain); …Run Code Online (Sandbox Code Playgroud) 我想从URL列表中提取域名(站点名称+ TLD),这些URL的格式可能不同.例如:当前状态---->我想要什么
mail.yahoo.com------> yahoo.com
account.hotmail.co.uk---->hotmail.co.uk
x.it--->x.it
google.mail.com---> google.com
Run Code Online (Sandbox Code Playgroud)
是否有任何python代码可以帮助我从URL中提取我想要的内容,还是应该手动执行?
在上下文URL重写2.0在IIS 7.5中,我希望能够执行多个域的规范域名为多国网站,在尽可能少的规则可能.像这样的东西:
<rule name="UK Host Name">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll">
<add input="{HTTP_HOST}" pattern="^company\.co\.uk$" />
<add input="{HTTP_HOST}" pattern="^company\.co$" />
<add input="{HTTP_HOST}" pattern="^company\.org$" />
<add input="{HTTP_HOST}" pattern="^company\.net$" />
<add input="{HTTP_HOST}" pattern="^company\.uk\.com$" />
<add input="{HTTP_HOST}" pattern="^www\.company\.co\.uk$" negate="true" />
</conditions>
<action type="Redirect" url="http://www.company.co.uk/{R:1}" />
</rule>
<rule name="France Host Name">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll">
<add input="{HTTP_HOST}" pattern="^company\.fr$" />
<add input="{HTTP_HOST}" pattern="^company-france\.com$" />
<add input="{HTTP_HOST}" pattern="^www\.company\.fr$" negate="true" />
</conditions>
<action type="Redirect" url="http://www.company.fr/{R:1}" />
</rule>
Run Code Online (Sandbox Code Playgroud)
我认为,上述问题是每个条件都必须为真,logicalGrouping="MatchAll"但如果改为,MatchAny那么最后一个条件(with negate="true" …
比如说free.webhost.com/app1,当运行两个不同的网站时,free.webhost.com/app2似乎Firefox无法为两者存储不同的登录凭据,尤其是当相同的用户名与不同的密码一起使用时.如果/app1站点上的用户凭据是Name和,pass1并且在另一个站点上是Name和pass2,那么Firefox只能存储其中一个,并且会在它们之间跳转时要求更改密码.
我调查了这个问题,令我惊讶的是,它似乎是firefox bug存储库中的一个WONTFIX:https://bugzilla.mozilla.org/show_bug.cgi?id = 263387
在设计我的应用程序时,有什么方法可以解决这个问题吗?比如在PHP或html中设置某个cookie属性,或者甚至指定一个(假的)不同的域名,这样firefox就不再考虑free.webhost.com/app1并且free.webhost.com/app2作为密码存储的同一个网站(因此可以存储具有相同用户名的不同密码)两个网站)?
给出网站地址,例如
http://www.example.com/page1/#
https://subdomain.example2.co.uk/asdf?retrieve=2
Run Code Online (Sandbox Code Playgroud)
如何返回根域R,例如
example.com
example2.co.uk
Run Code Online (Sandbox Code Playgroud)
为了我的目的,我将定义根域具有结构
example_name.public_suffix
Run Code Online (Sandbox Code Playgroud)
其中example_name排除"www",public_suffix在此列表中:
https://publicsuffix.org/list/effective_tld_names.dat
这仍然是最好的基于正则表达式的解决方案:
那么R根据公共后缀列表解析根域的内容如下:
http://simonecarletti.com/code/publicsuffix/
使用XML::parseURI似乎返回第一个"//"和"/"之间的东西.例如
> parseURI("http://www.blog.omegahat.org:8080/RCurl/index.html")$server
[1] "www.blog.omegahat.org"
Run Code Online (Sandbox Code Playgroud)
因此,问题减少为具有R可以从URI返回公共后缀的函数,或者在公共后缀列表上实现以下算法:
我使用此代码片段获取 Whois 信息:
org.apache.commons.net.whois.WhoisClient whois = new org.apache.commons.net.whois.WhoisClient();
whois.connect("whois.verisign-grs.com", 43);
String domainWhois = whois.query(domainName);
whois.disconnect();
Run Code Online (Sandbox Code Playgroud)
我获得了创建、到期日期、注册商和名称服务器,但没有与管理或技术联系人相关的数据。有什么办法可以得到它们吗?