Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/go/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Networking Golang DNS解析不工作_Networking_Go_Dns_Network Programming - Fatal编程技术网

Networking Golang DNS解析不工作

Networking Golang DNS解析不工作,networking,go,dns,network-programming,Networking,Go,Dns,Network Programming,我读了很多书,但就是找不到解决办法 我在Google Cloud中打开了一个VPS,用Ubuntu启动了一个实例,并运行了一个我在80端口的Go侦听中编写的web服务器。我还在我的国家注册了一个域名www.crosslogic.com.ar,授权如下: n1.crosslogic.com.ar 130.211.196.55 n2.crosslogic.com.ar 130.211.196.55 (需要两个IP,但我只有一个IP) 当我在浏览器中键入IP时,一切正常,但当我尝试使用w

我读了很多书,但就是找不到解决办法

我在Google Cloud中打开了一个VPS,用Ubuntu启动了一个实例,并运行了一个我在80端口的Go侦听中编写的web服务器。我还在我的国家注册了一个域名www.crosslogic.com.ar,授权如下:

n1.crosslogic.com.ar    130.211.196.55
n2.crosslogic.com.ar    130.211.196.55
(需要两个IP,但我只有一个IP)

当我在浏览器中键入IP时,一切正常,但当我尝试使用www.crosslogic.com.ar、crosslogic.com.ar或n1.crosslogic.com.ar访问服务器时,我得到错误名称\解析\失败

我在dns.com/crosslogic.com.ar中进行了此测试,以检查以下错误:

-Missing nameservers reported by your nameservers. You should already know that your NS records at your nameservers are missing, so here it is again:
ns2.crosslogic.com.ar.
ns1.crosslogic.com.ar.

-No valid SOA record came back!

-ERROR: I could not get any A records for www.crosslogic.com.ar!
(I only do a cache request, if you recently added a WWW A record, it might not show up here.) 
代码如下:

package main

import (
    "net/http"
)

func main() {
    // Genero un html con los detalles del calculo.


    http.HandleFunc("/", indexHandler)
    err := http.ListenAndServe(":80", nil)
    if err != nil {
        fmt.Println(err.Error())
    }

}

func indexHandler(w http.ResponseWriter, r *http.Request) {

    temp, err := template.ParseFiles("index.html")
    if err != nil {
        panic(err)
    }

    err = temp.Execute(w, nil)
    if err != nil {
        panic(err)
    }
}

我是否缺少Linux中的任何配置?那些NS记录、A记录和SOA是我需要在服务器中配置的吗?http/net不应该处理这些东西吗?为什么请求未到达我的端口80?

问题与您的代码无关。您的DNS未正确注册。运行
nslookup
时,我得到以下信息:

$ nslookup n1.crosslogic.com.ar

DNS request timed out.
    timeout was 2 seconds.
DNS request timed out.
    timeout was 2 seconds.
DNS request timed out.
    timeout was 2 seconds.
DNS request timed out.
    timeout was 2 seconds.

$ nslookup n2.crosslogic.com.ar

DNS request timed out.
    timeout was 2 seconds.
DNS request timed out.
    timeout was 2 seconds.
DNS request timed out.
    timeout was 2 seconds.
DNS request timed out.
    timeout was 2 seconds.
当你说“你的DNS”时,你的意思是我必须在我的服务器上安装像BIND这样的东西,或者这是一个与域注册相关的问题?