php.net 上有一个示例,如何通过两步获取最后两个域段:
<?php
//get host name from URL
preg_match("/^(http:\/\/)?([^\/]+)/i",
"http://www.php.net/index.html", $matches);
$host = $matches[2];
// get last two segments of host name
preg_match("/[^\.\/]+\.[^\.\/]+$/", $host, $matches);
echo "domain name is: {$matches[0]}\n";
/* Output is php.net */
?>
Run Code Online (Sandbox Code Playgroud)
但是我怎样才能一步完成,仅使用一个 preg_match 表达式呢?
我想要获取主机名 www.example.com 的 MX 记录。节点有它的功能。
dns.resolveMx(domain, callback)
Run Code Online (Sandbox Code Playgroud)
但我不想要那个回调的东西。我想要同步通话之类的东西。例如
var records = dns.resolveMx(domain);
Run Code Online (Sandbox Code Playgroud)
这可能吗 ?
(注意:- 我在 Node 文档中找到了该函数。链接:- http://nodejs.org/api/dns.html)
如果我有一个通配符 DNS 条目:
*.mydomain.com => 1.2.3.4
Run Code Online (Sandbox Code Playgroud)
另一个标准A记录:
foo.mydomain.com => 7.6.5.4
Run Code Online (Sandbox Code Playgroud)
哪个记录优先?有没有办法强制fooA 记录优先,并且只有在不存在 A 记录时才回退到通配符?
当我发送 DNS 时,如何使用wireshark 知道我使用的是迭代方式还是递归方式?
I have a rest application sitting on an IIS server (on the public internet) with a configuration as follows:
(The entry isn't in the public dns simply because it doesn't have to be. This isn't merely security by obscuring host headers.)
In order to get my client to connect to the application, I simply add an entry in my hosts file:
A.B.C.D something-not-public-dns.example.com
With the hosts file entry everything works great.
The problem is …
我一直在寻找与DNS的方法来重定向我的域名的子域如http://server.my-domain.com到https://discordapp.com/invite/server
我们已将 VPN 从 AWS VPC 连接到本地服务器场。我们希望为从 Amazon Route 53 到端点(通过 VPN 的 OnPrem IP)的服务器创建健康检查,以启用 DNS 故障转移。
我正在从事网站开发,现在我已经建立了网站并在 Firebase 中运行。
问题是我需要添加一个文件夹,但这需要在子域中,即,
域:example.firebaseapp.com 包含我的网站需要的所有资产和内容。子域:design-explorer.example.firebaseapp.com 这是我必须添加新文件夹的地方。
有可能这样做吗?我一直在阅读文档,但没有关于它的信息。
我有一个前端React应用程序和一个Go后端服务作为前端的API。两者都是同一名称空间中的Kubernetes服务。在不使用外部IP的情况下如何与Go后端服务通信?我知道它可以与外部ip一起使用,但是我无法让fqdn像应该的那样正确解析。前端服务是从nginx:1.15.2-alpinedocker映像构建的。如何获得前端React应用与后端Go服务器通信?
前端service.yaml:
apiVersion: v1
kind: Service
metadata:
name: ui
namespace: client
labels:
app: ui
spec:
type: NodePort
ports:
- name: http
port: 80
targetPort: http
- name: https
port: 443
targetPort: https
selector:
app: ui
Run Code Online (Sandbox Code Playgroud)
前端Deployment.yaml:
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: ui
namespace: client
spec:
replicas: 1
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 0
maxSurge: 2
template:
metadata:
labels:
app: ui
spec:
containers:
- name: ui
image: #######
imagePullPolicy: IfNotPresent
ports:
- name: http
containerPort: 80
Run Code Online (Sandbox Code Playgroud)
后端service.yaml:
apiVersion: …Run Code Online (Sandbox Code Playgroud) Kubernetes 有没有办法为应该返回多个 IP 地址的外部服务创建服务?目前我正在通过在我的公共 DNS 提供商(route53)中创建一个 A 记录,然后在 Kubernetes 中创建一个服务来解决这个问题:
apiVersion: v1
kind: Service
metadata:
name: rabbitmq
labels:
app: rabbitmq
spec:
type: ExternalName
externalName: rabbitmq.mydomainhere.dev
Run Code Online (Sandbox Code Playgroud)
有没有办法在 Kubernetes 中本地创建服务,该服务返回一组固定的 IP 地址,这些 IP 地址不在 Kubernetes 集群内部管理,而无需创建公共 DNS 记录并使用externalName?