## Import DNS Records `client.DNS.Records.Import(ctx, params) (*RecordImportResponse, error)` **post** `/zones/{zone_id}/dns_records/import` You can upload your [BIND config](https://en.wikipedia.org/wiki/Zone_file "Zone file") through this endpoint. It assumes that cURL is called from a location with bind_config.txt (valid BIND config) present. See [the documentation](https://developers.cloudflare.com/dns/manage-dns-records/how-to/import-and-export/ "Import and export records") for more information. ### Parameters - `params RecordImportParams` - `ZoneID param.Field[string]` Path param: Identifier. - `File param.Field[string]` Body param: BIND config to import. **Tip:** When using cURL, a file can be uploaded using `--form 'file=@bind_config.txt'`. - `Proxied param.Field[string]` Body param: Whether or not proxiable records should receive the performance and security benefits of Cloudflare. The value should be either `true` or `false`. ### Returns - `type RecordImportResponse struct{…}` - `RecsAdded float64` Number of DNS records added. - `TotalRecordsParsed float64` Total number of DNS records parsed. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) response, err := client.DNS.Records.Import(context.TODO(), dns.RecordImportParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), File: cloudflare.F("www.example.com. 300 IN A 127.0.0.1"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.RecsAdded) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "recs_added": 5, "total_records_parsed": 5 } } ```